NAME

Shell::DeLuxe - A generic class to build line-oriented command interpreters.

SYNOPSIS

package My::Shell;

use base qw(Shell::DeLuxe);

sub do_greeting {
    return "Hello!"
}

DESCRIPTION

Shell::DeLuxe is a base class designed for building command line programs. It is based on (inherits from) Shell::Base;

Features

Shell::DeLuxe extends Shell::Base with the following features:

Reading commands from files

This implements batch processing in the style of "sh < commands.sh".

All commands are read from the standard input, and processing terminates after the last command has been read.

Single command execution

This implements command execution in the style of "sh -c 'command'".

One single command is executed.

METHODS

new

The constructor is called new. new should be called with a reference to a hash of name => value parameters:

  my $opts = { OPTION_1 => $one,
	       OPTION_2 => $two };

  my $shell = Shell::DeLuxe->new($opts);

Shell::DeLuxe extends the options of Shell::Base with:

interactive

Controls whether this instance is interactive, i.e, uses ReadLine to read commands.

Defaults to true unless the standard input is not a terminal.

command

Controls whether this instance executes a single command, that is contained as an array reference in the value of this option.

my $opts = { command => [ "exec", "this", "command" ] };
my $shell = Shell::DeLuxe->new($opts);
$shell->run;
prompt

The prompt for commands.

echo

If true, commands read from the standard input are echoed with the value of this option as a prefix. Valid for non-interactive use only.

AUTHOR

Johan Vromans <jvromans@squirrel.nl<gt>

COPYRIGHT

Copyright (C) 2005 Squirrel Consultancy. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 172:

You forgot a '=back' before '=head1'