App-CmdDispatch
view release on metacpan or search on metacpan
lib/App/CmdDispatch.pm view on Meta::CPAN
This optional parameter gives a fuller explanation of the command. It often
extends across several lines. The idea is to explain the functionality of the
command to someone that is not familiar with it.
When B<help> is invoked, the C<help> text is displayed after the line
containing the C<clue>.
If the parameter is not supplied and B<help> is invoked, nothing is used by
default.
=back
=head3 The $options hash
This hash determines some of the default behavior of the C<App::CmdDispatch>
object.
=over 4
=item config_file
This option is the name of a configuration file that is read using the format
specified in L<Config::Tiny>. This sets default configuration parameters and
aliases.
=item default_commands
This string provides a space separated list of default command behaviors.
The two supported behaviors are:
=over 4
=item help
Provide a B<help> command and a B<hint> command through the
L<App::CmdDispatch::Help> module.
=item shell
Prove a shell interface that loops asking for subcommands. Each command
is executed and contol returns to the loop.
=back
=item io
An object supplying input and output services for the CmdDispatcher. This
object must provide both a C<print> method and a C<prompt> method. See
L<App::CmdDispatch::IO> for more information on the interface.
=item help:*
The options beginning with the string 'help:' are described in the docs for
L<App::CmdDispatch::Help>.
=back
=head2 run( $cmd, @args )
This method looks up the supplied command and executes it.
=head2 command_hint( $cmd )
This method prints a short hint listing all commands and aliases or just the
hint for the supplied command.
=head2 hint( $cmd )
This method prints a short hint listing all commands and aliases or just the
hint for the supplied command.
=head2 help( $cmd )
This method prints help for the program or just help on the supplied command.
=head2 shell()
This method start a read/execute loop which supports running multiple commands
in the same execution of the main program.
=head2 get_config()
This method returns a reference to the configuration hash for the dispatcher.
=head2 command_list()
This method returns the list of commands in a defined order.
=head2 alias_list()
This method returns the list of aliases in sorted order.
=head1 CONFIGURATION AND ENVIRONMENT
C<App::CmdDispatch> can read a configuration file specified in a
L<Config::Tiny> supported format. Should be specified in the config parameter.
=head1 DEPENDENCIES
Config::Tiny
Term::Readline
=head1 INCOMPATIBILITIES
None reported.
=head1 BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests to
C<bug-app-cmddispatch@rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org>.
=head1 AUTHOR
G. Wade Johnson C<< <wade@cpan.org> >>
=head1 LICENCE AND COPYRIGHT
( run in 2.429 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )