in reply to Re^4: Using Tab Completion on Windows in cmd.exe
in thread Using Tab Completion on Windows in cmd.exe
package MyShell; $ENV{TERM} = ''; use base qw(Term::Shell); sub run_command1 { print "command 1!\n"; } sub smry_command1 { "what does command1 do?" } sub help_command1 { "Help on 'command1', whatever that may be..." } sub run_command2 { print "command 2!\n"; } package main; my $shell = MyShell->new; $shell->cmdloop;
use Term::ReadLine; $ENV{TERM} = ''; my $term = Term::ReadLine->new('Tab Completion'); my $prompt = ">>> "; &readline::rl_basic_commands( qw(set quit type test run exit) ); while ( defined ( $_ = $term->readline($prompt) ) ) { exit if /exit/ or /quit/; print $_, "\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Using Tab Completion on Windows in cmd.exe
by Anonymous Monk on Nov 26, 2011 at 14:09 UTC |