+
+ return $ok;
+}
+
+getopts('cdlnphu');
+
+&help() if $opt_h;
+$opt_n = 1 if $opt_p;
+$opt_u = 1 if $opt_d;
+
+die "Need one of -[cdlnpu] flags.\n"
+ unless $opt_c or $opt_l or $opt_n or $opt_u;
+
+if ( $opt_c ) {
+ my $ok = 1;
+ my @commands = ();
+
+ # Get list of commands.
+ open FH, "./apps/openssl list -1 -commands|"
+ || die "Can't list commands, $!";
+ while ( <FH> ) {
+ chop;
+ push @commands, $_;
+ }
+ close FH;
+
+ # See if each has a manpage.
+ foreach ( @commands ) {
+ next if $_ eq 'help' || $_ eq 'exit';
+ if ( ! -f "doc/man1/$_.pod" ) {
+ print "doc/man1/$_.pod does not exist\n";
+ $ok = 0;
+ } else {
+ $ok = 0 if not &checkflags($_);
+ }
+ }
+
+ # See what help is missing.
+ open FH, "./apps/openssl list --missing-help |"
+ || die "Can't list missing help, $!";
+ while ( <FH> ) {
+ chop;
+ my ($cmd, $flag) = split;
+ print "$cmd has no help for -$flag\n";
+ $ok = 0;
+ }
+ close FH;
+
+ exit 1 if not $ok;