App::CLI::Command - Base class for App::CLI commands
package MyApp::List; use base qw(App::CLI::Command); use constant options => ( 'verbose' => 'verbose', 'n|name=s' => 'name', ); sub run { my ( $self, $arg ) = @_; print "verbose" if $self->{verbose}; my $name = $self->{name}; # get arg following long option --name # anything you want this command do } # See App::CLI for information of how to invoke (sub)command.
return old genre subcommand of $self;
Return instance of cascading subcommand invoked if it was listed in your constant subcommands.
Return package name of subcommand if the subcommand invoked is in your constant subcommands, otherwise, return undef.
undef
Return the object referring to the current app.
Display a one-line brief usage of the command object. Optionally, a file could be given to extract the usage from the POD.
Display usage. If $want_detail is true, the DESCRIPTION section is displayed as well.
$want_detail
DESCRIPTION
Localizes the body of (formatted) text in $text and returns the localized version.
$text
Return the filename for the command module.
App::CLI, Getopt::Long
Chia-liang Kao <clkao@clkao.org>
Cornelius Lin <cornelius.howl@gmail.com>
Shelling <navyblueshellingford@gmail.com>
Paul Cochrane <paul@liekut.de> (current maintainer)
Copyright 2005-2006 by Chia-liang Kao <clkao@clkao.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install App::CLI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::CLI
CPAN shell
perl -MCPAN -e shell install App::CLI
For more information on module installation, please visit the detailed CPAN module installation guide.