Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to write minimal command line interface?

by delirium (Chaplain)
on Dec 29, 2003 at 13:31 UTC ( [id://317423]=note: print w/replies, xml ) Need Help??


in reply to How to write minimal command line interface?

This style of a command line interface works well for me:

perl -e 'while(1) {print "::> "; $_=<STDIN>; print $/,eval $_ || '0'; +print "\n$@"}'

...but perhaps you could tell us more about what you are trying to do, some code you have for it, etc.

Replies are listed 'Best First'.
Re: Re: How to write minimal command line interface?
by kandelabr (Novice) on Dec 30, 2003 at 03:43 UTC
    Ahh, thanks, that is neat!

    I want that shell to present some kind of user interface for inputting a very limited set of commands. These commands will controll display of logs from about 30 machines. I have logs cleaned up, and ready to be displayed in a sanitized state with some minimal statistics as number of connections, top 10 speakers, etc.

    The shell should be able to parse something like:

    use domain.com
    #select subset of data to work on
    show smtpproxy top10
    #display top 10 smtpproxy users for domain.com

    Assume that in the above case I would have a smtpproxy function take the domain and the option (top10) as arguments, and display formated data.

    Term::Shell might be the answer, I missed it in my search somehow. At the same time I would be glad to use my own and learn something in the process.

    -- maciek

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://317423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found