From 4c8b313a2378b1c1e7f46d7bf79542eedb20ff25 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 19 Aug 2002 14:55:06 +0000 Subject: Add script to find undocumented smb.conf options (This used to be commit 77152b4033f13abcdb86c7835f3112fa422a420d) --- source3/script/find_missing_doc.pl | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 source3/script/find_missing_doc.pl (limited to 'source3/script') diff --git a/source3/script/find_missing_doc.pl b/source3/script/find_missing_doc.pl new file mode 100755 index 0000000000..4d22e20a29 --- /dev/null +++ b/source3/script/find_missing_doc.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w + +#reads in the list of parameters from the source +#compares this list to the list of parms documented in the docbook source +#prints out the names of the parameters that are in need of documentation +# (C) 2002 Bradley W. Langhorst" + +my $doc_file = "./docs/docbook/manpages/smb.conf.5.sgml"; +my $source_file = "./source/param/loadparm.c"; +my $ln; +my %params; + +open(SOURCE, "<$source_file") || + die "Unable to open $source_file for input: $!\n"; +open(DOC, "<$doc_file") || + die "Unable to open $doc_file for input: $!\n"; + +while ($ln= ) { + last if $ln =~ m/^static\ struct\ parm_struct\ parm_table.*/; +} #burn through the preceding lines + +while ($ln = ) { + last if $ln =~ m/^\s*\}\;\s*$/; + #pull in the param names only + next if $ln =~ m/.*P_SEPARATOR.*/; + $ln =~ m/.*\"(.*)\".*/; + $params{lc($1)}='not_found'; #not case sensitive +} +close SOURCE; +#now read in the params list from the docs +@doclines = ; + +foreach $ln (grep (/\\s*(?:\<.*?\>)*\s*(.*?)(?:\s*\(?[S,G]?\)?\s*(\<\/term\>)?){1}\s*$/; + #print "got: $1 from: $ln"; + if (exists $params{lc($1)}) { + $params{$1} = 'found'; + } +} + +foreach (keys %params) { + print "$_\n" if $params{$_} eq 'not_found'; +} -- cgit