diff options
Diffstat (limited to 'contrib/checkOptionDocs.pl')
-rwxr-xr-x | contrib/checkOptionDocs.pl | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/contrib/checkOptionDocs.pl b/contrib/checkOptionDocs.pl index ca3fba55e..23e57b489 100755 --- a/contrib/checkOptionDocs.pl +++ b/contrib/checkOptionDocs.pl @@ -1,27 +1,17 @@ #!/usr/bin/perl -w -# $Id use strict; my %options = (); my %descOptions = (); my %torrcSampleOptions = (); -my %torrcCompleteOptions = (); my %manPageOptions = (); # Load the canonical list as actually accepted by Tor. -my $mostRecentOption; open(F, "./src/or/tor --list-torrc-options |") or die; while (<F>) { next if m!\[notice\] Tor v0\.!; if (m!^([A-Za-z0-9_]+)!) { - $mostRecentOption = lc $1; - $options{$mostRecentOption} = 1; - } elsif (m!^ !) { - $descOptions{$mostRecentOption} = 1; - if (m!\{DEPRECATED\}!) { - delete $descOptions{$mostRecentOption}; - delete $options{$mostRecentOption}; - } + $options{$1} = 1; } else { print "Unrecognized output> "; print; @@ -29,7 +19,7 @@ while (<F>) { } close F; -# Load the contents of torrc.sample and torrc.complete +# Load the contents of torrc.sample sub loadTorrc { my ($fname, $options) = @_; local *F; @@ -37,7 +27,7 @@ sub loadTorrc { while (<F>) { next if (m!##+!); if (m!#([A-Za-z0-9_]+)!) { - $options->{lc $1} = 1; + $options->{$1} = 1; } } close F; @@ -45,23 +35,14 @@ sub loadTorrc { } loadTorrc("./src/config/torrc.sample.in", \%torrcSampleOptions); -loadTorrc("./src/config/torrc.complete.in", \%torrcCompleteOptions); # Try to figure out what's in the man page. my $considerNextLine = 0; -open(F, "./doc/tor.1.in") or die; +open(F, "./doc/tor.1.txt") or die; while (<F>) { - if ($considerNextLine and - m!^\\fB([A-Za-z0-9_]+)!) { - $manPageOptions{lc $1} = 1; - next; - } - - if (m!^\.(?:SH|TP|PP)!) { - $considerNextLine = 1; next; - } else { - $considerNextLine = 0; + if (m!^\*\*([A-Za-z0-9_]+)\*\*!) { + $manPageOptions{$1} = 1; } } close F; @@ -78,11 +59,9 @@ sub subtractHashes { 0; } -subtractHashes("No online docs", \%options, \%descOptions); +# subtractHashes("No online docs", \%options, \%descOptions); # subtractHashes("Orphaned online docs", \%descOptions, \%options); -subtractHashes("Not in torrc.complete.in", \%options, \%torrcCompleteOptions); -subtractHashes("Orphaned in torrc.complete.in", \%torrcCompleteOptions, \%options); subtractHashes("Orphaned in torrc.sample.in", \%torrcSampleOptions, \%options); subtractHashes("Not in man page", \%options, \%manPageOptions); |