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