Al Newkirk > SweetPea-Cli-0.08 > App::Rad::Command

Download:
SweetPea-Cli-0.08.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

DESCRIPTION ^

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',
              }
        }
  )
syntax highlighting: