]> git.proxmox.com Git - pmg-docs.git/blame - gen-pmg.conf.5-opts.pl
pmgconfig.adoc: add missing config files
[pmg-docs.git] / gen-pmg.conf.5-opts.pl
CommitLineData
f872534d
DM
1#!/usr/bin/perl
2
3use lib '.';
4use strict;
5use warnings;
6use PVE::RESTHandler;
7
8use Data::Dumper;
9
10use PMG::Config;
11
12my $types = PMG::Config::Base->lookup_types;
13
7608b70c
DM
14my $single_section = shift;
15my $found = 0;
16
f872534d
DM
17foreach my $section (@$types) {
18 my $plugin = PMG::Config::Base->lookup($section);
19 my $schema = $plugin->updateSchema(1);
20 my $properties = $schema->{properties};
7608b70c
DM
21
22 if (defined($single_section)) {
23 next if $section ne $single_section;
24 } else {
25 print ".Section '$section'\n\n";
26 }
27
28 $found = 1;
a18c67c0
DM
29
30 my $filter = sub {
31 my ($key, $phash) = @_;
32 return 1 if $key eq 'digest';
33 return 1 if $key eq 'delete';
34 return 0;
35 };
f872534d 36
a18c67c0
DM
37 print PVE::RESTHandler::dump_properties(
38 $properties, 'asciidoc', 'config', $filter);
f872534d 39}
7608b70c
DM
40
41if (defined($single_section)) {
42 die "no such section '$single_section'" if !$found;
43}
f872534d
DM
44
45exit(0);