App::Rad::Command - App::Rad::Command documentation


SweetPea-Cli documentation  | view source Contained in the SweetPea-Cli distribution.

Index


DESCRIPTION

Top

You can register a command in App::Rad in three diferent ways:

Simple register:

  $c->register('foo');            # "./myapp foo" goes to \&foo
  $c->register('foo', \&bar);     # "./myapp foo" goes to \&bar




Register with help text

  $c->register('foo', \&bar, 'this is the help for command foo');

Extended arguments registering

  $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.