X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=util%2Ffind-doc-nits;h=c1e33fcfe455a0eae08660d1c45a601db856141d;hp=74018e799979aa7ad4cf12498970200a2fe4e99b;hb=185ec4be6d3beac8cb262415c48e78b129f7efd2;hpb=df553b79419230d698d221919c7ceec68aa8c6c6 diff --git a/util/find-doc-nits b/util/find-doc-nits index 74018e7999..c1e33fcfe4 100755 --- a/util/find-doc-nits +++ b/util/find-doc-nits @@ -33,24 +33,39 @@ our($opt_u); our($opt_v); our($opt_c); +# Print usage message and exit. sub help { print < 0; + err("# $count macros undocumented (count is approximate)") + if $count > 0; } sub printem { @@ -627,13 +641,13 @@ sub printem { # Skip functions known to be missing next if $opt_v && grep( /^$func$/, @missing); - print "$libname:$func\n" + err("$libname:", "function $func undocumented") if $opt_d || $opt_e; $count++; $seen{$func} = 1; } - print "# Found $count missing from $numfile\n\n" - if !$opt_s || $count > 0; + err("# $count in $numfile are not documented") + if $count > 0; } @@ -721,6 +735,7 @@ sub checklinks { } } +# Load the public symbol/macro names sub publicize { foreach my $name ( parsenum('util/libcrypto.num') ) { $public{$name} = 1; @@ -728,7 +743,7 @@ sub publicize { foreach my $name ( parsenum('util/libssl.num') ) { $public{$name} = 1; } - foreach my $name ( parsenum('util/private.num') ) { + foreach my $name ( parsenum('util/other.syms') ) { $public{$name} = 1; } } @@ -811,25 +826,6 @@ sub checkflags { } } -getopts('cdesolnphuv'); - -help() if $opt_h; - -$opt_n = 1 if $opt_p; -$opt_u = 1 if $opt_d; -$opt_e = 1 if $opt_s; -$opt_v = 1 if $opt_o || $opt_e; - -die "Cannot use both -u and -v" - if $opt_u && $opt_v; -die "Cannot use both -d and -e" - if $opt_d && $opt_e; - -# We only need to check c, l, n, u and v. -# Options d, e, s, o and p imply one of the above. -die "Need one of -[cdesolnpuv] flags.\n" - unless $opt_c or $opt_l or $opt_n or $opt_u or $opt_v; - if ( $opt_c ) { my @commands = (); @@ -876,15 +872,12 @@ if ( $opt_l ) { } if ( $opt_n ) { - publicize() if $opt_p; + publicize(); foreach (@ARGV ? @ARGV : (glob('doc/*/*.pod'), glob('doc/*/*.pod.in'))) { check($_); } - { - local $opt_p = undef; - foreach (@ARGV ? @ARGV : glob('doc/internal/*/*.pod')) { - check($_); - } + foreach (@ARGV ? @ARGV : glob('doc/internal/*/*.pod')) { + check($_); } # If not given args, check that all man1 commands are named properly.