| SweetPea-Cli documentation | view source | Contained in the SweetPea-Cli distribution. |
You can register a command in App::Rad in three diferent ways:
$c->register('foo'); # "./myapp foo" goes to \&foo
$c->register('foo', \&bar); # "./myapp foo" goes to \&bar
$c->register('foo', \&bar, 'this is the help for command foo');
$c->register(
'foo' => {
"length" => {
type => "num",
condition => sub { $_ > 0 },
aliases => [ 'len', 'l' ],
to_stash => 'mylength',
required => 1,
help => 'help for the length attribute',
}
}
)
| SweetPea-Cli documentation | view source | Contained in the SweetPea-Cli distribution. |