CLI::Dispatch::Docopt - CLI dispatcher with affinity for Docopt
in my_command.
my_command
use Docopt; use CLI::Dispatch::Docopt; my $opt = docopt(argv => \@ARGV); run('MyApp::CLI' => $opt); __END__ =head1 NAME my_command =head1 SYNOPSIS my_command <sub_command> [--foo]
in MyApp::CLI::Qux.
MyApp::CLI::Qux
package MyApp::CLI::Qux; use Data::Dumper; sub run { my ($self, $opt) = @_; warn __PACKAGE__. " run!\n". Dumper($opt); } 1;
then execute my_command like this.
$ my_command qux --foo MyApp::CLI::Qux run! $VAR1 = { '<sub_command>' => 'qux', '--foo' => bless( do{\(my $o = '1')}, 'boolean' ) };
CLI::Dispatch::Docopt is the CLI dispatcher with affinity for Docopt.
The run function is exported from CLI::Dispatch::Docopt.
run
CLI::Dispatch::Docopt
CLI::Dispatch::Docopt is hosted on github <http://github.com/bayashi/CLI-Dispatch-Docopt>
Welcome your patches and issues :D
Dai Okabayashi <bayashi@cpan.org>
Docopt
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install CLI::Dispatch::Docopt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CLI::Dispatch::Docopt
CPAN shell
perl -MCPAN -e shell install CLI::Dispatch::Docopt
For more information on module installation, please visit the detailed CPAN module installation guide.