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 a122b0b069ae60cf3433d08412986ecebfb83b55..95c9f410f11f8aa83e50d739f149a2d081330057 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"
        ;
 }