Commits

Anonymous committed 552fd62

Added the --help/-h and --man flags.

  • Participants
  • Parent commits 8af9de9

Comments (0)

Files changed (2)

modules/App-XML-DocBook-Docmake/lib/App/XML/DocBook/Docmake.pm

 
 use Getopt::Long qw(GetOptionsFromArray);
 use File::Path;
+use Pod::Usage;
 
 use base 'Class::Accessor';
 
     my $stylesheet;
     my @in_stringparams;
     my $make_like = 0;
+    my ($help, $man);
 
     my $ret = GetOptionsFromArray($argv,
         "o=s" => \$output_path,
         "x|stylesheet=s" => \$stylesheet,
         "stringparam=s" => \@in_stringparams,
         "make" => \$make_like,
+        'help|h|?' => \$help,
+        'man' => \$man,        
     );
 
+    if (!$ret)
+    {
+        pod2usage(2);
+    }
+    if ($help)
+    {
+        pod2usage(1);
+    }
+    if ($man)
+    {
+        pod2usage(-exitstatus => 0, -verbose => 2)
+    }
+
     my @stringparams;
     foreach my $param (@in_stringparams)
     {

modules/App-XML-DocBook-Docmake/script/docmake

 
 =over 4
 
+=item * -h ; --help
+
+Display some rudimentary help.
+
+=item * --man
+
+Display the man page.
+
 =item * -v ; --verbose
 
 Verbose - output the commands' invocation as they are executed.