Getopt::Compact::WithCmd

Sub-command friendly, like Getopt::Compact
Download

Getopt::Compact::WithCmd Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Yuji Shimada
  • Publisher web site:
  • http://search.cpan.org/~xaicron/

Getopt::Compact::WithCmd Tags


Getopt::Compact::WithCmd Description

Sub-command friendly, like Getopt::Compact Getopt::Compact::WithCmd is yet another Getopt::* Perl module. This module is respected Getopt::Compact. This module is you can define of git-like option. In addition, usage can be set at the same time.SYNOPSISinside foo.pl: use Getopt::Compact::WithCmd; my $go = Getopt::Compact::WithCmd->new( name => 'foo', version => '0.1', args => 'FILE', global_struct => , 'force overwrite', '!', \my $force ], ], command_struct => { get => { options => , 'dest dir', '=s', undef, { default => '.' } ], , 'output file name', '=s', undef, { required => 1 }], ], desc => 'get file from url', args => 'url', other_usage => 'blah blah blah', }, remove => { ... } }, ); my $opts = $go->opts; my $cmd = $go->command; if ($cmd eq 'get') { my $url = shift @ARGV; }how will be like this: $ ./foo.pl -f get -o bar.html http://example.com/usage, running the command './foo.pl -x' results in the following output: $ ./foo.pl -x Unknown option: x foo v0.1 usage: foo.pl COMMAND FILE options: -h, --help This help message -f, --force Bool Force overwrite Implemented commands are: get Get file from url See 'foo.pl help COMMAND' for more information on a specific command.in addition, running the command './foo.pl get' results in the following output: $ ./foo.pl get `--output` option must be specified foo v0.1 usage: foo.pl get url options: -h, --help This help message -d, --dir Str (default: '.') Dest dir -o, --output Str (required) Output file name Requirements: · Perl


Getopt::Compact::WithCmd Related Software