Term::Shell::MultiCmd

Nested Commands Tree in Shell Interface
Download

Term::Shell::MultiCmd Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Josef Ezra
  • Publisher web site:
  • http://search.cpan.org/~jezra/

Term::Shell::MultiCmd Tags


Term::Shell::MultiCmd Description

Term::Shell::MultiCmd is a Perl module that provides nested commands tree in shell interface.SYNOPSIS # Examples are available with the distribution, under directory 'examples/' # This one is named examples/synopsis.pl use Term::Shell::MultiCmd; my @command_tree = ( 'multi word command' => { help => "Help title.", opts => 'force repeat=i', exec => sub { my ($o, %p) = @_ ; print "$p{ARG0} was called with force=$p{force} and repeat=$p{repeat}\n" }, }, 'multi word another command' => { help => 'Another help title. Help my have multi lines, the top one would be used when one linear needed.', comp => sub { # this function would be called when use hits tab completion at arguments my ($o, $word, $line, $start, $op, $opts) = @_ ; # .. do something, then return qw/a list of completion words/ ; }, exec => sub { my ($o, %p) = @_ ; print "$p{ARG0} was called\n"}, }, 'multi word third command' => { help => 'same idea', comp => , # this is also possible exec => sub { my ($o, %p) = @_ ; print "$p{ARG0} was called. Isn't that fun?\n"}, }, 'multi word' => 'You can add general help title to a path', ) ; Term::Shell::MultiCmd -> new() -> populate( @command_tree ) -> loop ; print "All done, see you later\n" ;Product's homepage


Term::Shell::MultiCmd Related Software