NAME
MooX::Commander::IsaHelpCommand - Add a help command to your command line app
SYNOPSIS
package PieFactory::Cmd::Help;
use Moo;
with 'MooX::Commander::IsaHelpCommand';
sub usage {
return >> EOF
usage: pie-factory [options]
You have inherited a pie factory. Use your powers wisely.
COMMANDS
pie-factory recipe list List pie recipes
pie-factory recipe show <recipe> Display a recipe
pie-factory recipe add <recipe> Add a recipe
pie-factory recipe delete <recipe> Delete a recipe
pie-factory bake <pie> Bake a pie
pie-factory eat <pie> Eat a pie
pie-factory throw <pie> <target> Throw a pie at something
pie-factory help <cmd> Get help with a command
OPTIONS
-v, --version pie-factory version
-h, --help Show this message
EOF
}
DESCRIPTION
MooX::Commander::IsaHelpCommand is a simple Moo::Role for adding a help command to your command line app.
It loads and instantiates the command class that the user is requesting help with and calls the usage()
method on that object. usage()
works the same way here as it does in MooX::Commander::HasOptions -- it prints the usage statement and exits the program unsuccessfuly.
LICENSE
Copyright (C) Eric Johnson.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Eric Johnson <eric.git@iijo.org>