Hi,
 
I was wondering if this is the wrong list for this.  Or is the description too vague?
 
Any help is appreciated.
 
thanks,
manish

Manish <[EMAIL PROTECTED]> wrote:

Hi,

I'm new to perl and I'm trying to write a simple
program that will take commands from user. I would
like to provide command completion.

Currently I have:

use Term::ReadLine;
use Term::Complete;

while (true)
{
$mainTerm = Term::ReadLine->new("Top Level");
$OUT = $mainTerm->OUT || *STDOUT;

# read command from user
$cmd = $mainTerm->readline ('client> ');
print $cmds{$cmd};

}

I see that it already provides history which is cool! 
Let's say I have the following commands available at
this level - help, exit, do-one, do-two. How do I add
this to the program so that when use types h it
completes help and when user doesn't type anything and
hits or it shows the possible
completions. Any response is appreciated :)

Also, can I modify it so that it will take these
commands from a file or the stdin. I can have an
option in commandline for reading from file (say, -f
). I know how to do the commandline arguments,
etc.

thanks,
manish



_______________________________
Do you Yahoo!?
Shop for Back-to-School deals on Yahoo! Shopping.
http://shopping.yahoo.com/backtoschool

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to