Term::Shell 0.01
Term::Shell is a simple command-line shell framework. SYNOPSIS package MyShell; use base qw(Term::Shell); sub r
|
|||||||||||||||||||
Term::Shell is a simple command-line shell framework.
SYNOPSIS
package MyShell;
use base qw(Term::Shell);
sub run_command1 { print "command 1!n"; }
sub smry_command1 { "what does command1 do?" }
sub help_command1 {
cmdloop;
Term::Shell lets you write simple command-line shells. All the boring details like command-line parsing, terminal handling, and tab completion are handled for you.
The base class comes with two commands pre-defined: exit and help.
To write a shell with an exec command, do something like this:
package MyShell;
use base qw(Term::Shell); # or manually edit @MyShell::ISA.
sub run_exec {
my ($o, $cmd, @args) = @_;
if ($cmd ne $0) {
print "I'm sorry you're leaving us...n";
}
exec $cmd, @args;
exit 1;
}
When Term::Shell needs to handle the exec command, it will invoke this method. That's all there is to it! You write handlers, and Term::Shell handles the gory details.
Requirements:
tags
Download Term::Shell 0.01
Authors software
|
|
|
|
|
|
Similar software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other software in this category
|
|
|
|
|
|
|
|
|
|
Featured Software
jEdit 4.3 pre8
jEdit is an Open Source text editor written in Java
Opera 9.02
Surf the Internet in a safer, faster, and easier way with Opera browser
GNU Aspell 0.60.4
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell
- Communications
- Database
- Desktop Environment
- Games
- Internet
- Multimedia
- Office
- Programming
- Science and Engineering
- System
- Text Editing&Processing
