diff options
| author | Iain Lane <iain@orangesquash.org.uk> | 2018-09-24 09:29:55 +0100 |
|---|---|---|
| committer | Iain Lane <iain@orangesquash.org.uk> | 2018-09-24 09:29:55 +0100 |
| commit | e152ec7bf4ba252ff9d3eb13eabd417b931dac9a (patch) | |
| tree | c323cf856ee0bb8e44590670dd54c19653a55748 /libnm/generate-plugin-docs.pl | |
| parent | ee9c73a923909e23a649407be77e25235d769e25 (diff) | |
Import Upstream version 1.12.2
Diffstat (limited to 'libnm/generate-plugin-docs.pl')
| -rwxr-xr-x | libnm/generate-plugin-docs.pl | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/libnm/generate-plugin-docs.pl b/libnm/generate-plugin-docs.pl index 24912a03..e4963b7c 100755 --- a/libnm/generate-plugin-docs.pl +++ b/libnm/generate-plugin-docs.pl @@ -46,25 +46,14 @@ use v5.10; # global variables my @keywords = ("property", "variable", "format", "values", "default", "example", "description"); -my @source_files; my @data; my $fo; -(scalar @ARGV == 3) or die "Usage: $0 <plugin> <srcdir> <output-xml-file>\n"; -my ($plugin, $srcdir, $output) = @ARGV; +(scalar @ARGV >= 3) or die "Usage: $0 <plugin> <output-xml-file> <srcfiles>\n"; +my ($plugin, $output, (@source_files)) = @ARGV; my $start_tag = "---$plugin---\\s*\$"; my $end_tag = '---end---'; -# get source files to scan for documentation comments (nm-setting-<something>.c) -my $file = "$srcdir/Makefile.am"; -open my $fh, '<', $file or die "Can't open $file: $!"; -while (my $line = <$fh>) { - if ($line =~ /^\t*(libnm-core\/nm-setting-[^.]*\.c)( \\)?$/g) { - push @source_files, $1; - } -} -close $fh; - # open output file open $fo, '>', $output or die "Can't open $output: $!"; @@ -73,11 +62,10 @@ write_header(); # write generated documenation for each setting foreach my $c_file (@source_files) { - my $path = "$srcdir/$c_file"; - my $setting_name = get_setting_name($path); + my $setting_name = get_setting_name($c_file); if ($setting_name) { write_item("<setting name=\"$setting_name\">"); - scan_doc_comments($path, $start_tag, $end_tag); + scan_doc_comments($c_file, $start_tag, $end_tag); write_item("</setting>"); } } |