get rid of warnings with applets that have no usage and get rid of pointless ---...
authorMike Frysinger <vapier@gentoo.org>
Mon, 6 Feb 2006 01:11:34 +0000 (01:11 -0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 6 Feb 2006 01:11:34 +0000 (01:11 -0000)
docs/autodocifier.pl

index a122b0b..95c9f41 100755 (executable)
@@ -51,10 +51,14 @@ sub pod_for_usage {
 
        # make options bold
        my $trivial = $usage->{trivial};
-       $trivial =~ s/(?<!\w)(-\w+)/B<$1>/sxg;
+       if (!defined $usage->{trivial}) {
+               $trivial = "";
+       } else {
+               $trivial =~ s/(?<!\w)(-\w+)/B<$1>/sxg;
+       }
        my @f0 =
                map { $_ !~ /^\s/ && s/(?<!\w)(-\w+)/B<$1>/g; $_ }
-               split("\n", $usage->{full});
+               split("\n", (defined $usage->{full} ? $usage->{full} : ""));
 
        # add "\n" prior to certain lines to make indented
        # lines look right
@@ -89,7 +93,6 @@ sub pod_for_usage {
                "$full\n\n"   .
                "$notes"  .
                "$example" .
-               "-------------------------------".
                "\n\n"
        ;
 }