NAME

Meta::Shell::Shell - expand Term::ReadLine.

COPYRIGHT

Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

MANIFEST: Shell.pm
PROJECT: meta
VERSION: 0.01

SYNOPSIS

package foo;
use Meta::Shell::Shell qw();
my($object)=Meta::Shell::Shell->new();
my($result)=$object->method();

DESCRIPTION

This class is exactly like Term::ReadLine except it has many more attributes and is able to run full readline loop for you where all you have to do is subclass it and implement the process method.

FUNCTIONS

BEGIN()
new($)
pre($)
run($)
post($)
process($$)
TEST($)

FUNCTION DOCUMENTATION

BEGIN()

Bootstrap method for the following attributes: 0. prompt - prompt to be used. 1. startup - read startup file ? 2. startup_file - startup file to read. 3. history - use history ? 4. history_file - history file to use. 5. quit - whether to quit mainloop or not. 6. verbose - whether to be verbose or not. 7. quit_yes_msg - print message in case of QUIT ? 8. quit_yes_msg_string - message to print in case of QUIT. 9. quit_no_msg - print message in case of EOF ? 10. quit_no_msg_string - message to print in case of EOF.

new($)

This is a constructor for the Meta::Shell::Shell object. This is not really needed and is present only because the regular Term::ReadLine constructor is buggy in that it does not bless into the class passed to it.

pre($)

Method to override to perform application specific intialization. Called from run before anything is done in that method.

run($)

This actually runs the shell interface.

post($)

Method to override to perform application specific cleanup. Called from run after the running is done and in case of sudden killing of the run method.

process($$)

This is the method to override and do whatever the commands need to do. The method receives the current object and the line received by the user.

TEST($)

This is a testing suite for the Meta::Shell::Shell module. This test is should be run by a higher level management system at integration or release time or just as a regular routine to check that all is well.

The reason that an explicit new is required here is that the regular Term::ReadLine constructor doesn't respect the class passed to it and does not bless right.

SUPER CLASSES

Term::ReadLine(3)

BUGS

None.

AUTHOR

Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER

HISTORY

0.00 MV teachers project
0.01 MV md5 issues

SEE ALSO

Meta::Class::MethodMaker(3), Meta::IO::File(3), Meta::Utils::Output(3), Meta::Utils::System(3), Term::ReadLine(3), strict(3)

TODO

-use MethodMaker capabilities to make the virtual functions here virtual instead of coding them.

-add more messages (like in case of errors for instance).