At 5:59 PM -0700 8/18/01, Nathaniel Irons wrote:
>I'm writing some shell utilities that will see a lot of punishment, and
>would benefit greatly from some common UI idioms.  Specifically, I'd
>like to know how to perform:

Some poorly thought out guesses follow.

>*  keyword completion - tab-expanding a term from a known set,
>    ideally with some facility for partial completion and
>    presentation of remaining options

Keep a buffer of characters typed after the last whitespace.  on 
tab-key, use buffer as key to hash of hashes.  Do the right thing if 
you get back a single entry or a hash. Load the hash at script 
initialization with something like Data::Dumper. (In other words, 
write a separate script to build the hash for you and save it in a 
meaningful way).

>*  in-place progress indicators - the ability to count from 1%
>    to 100%, without occupying more than one line of the buffer

Probably you have to play around with things under the Term:: hierarchy.

>*  external-editor handoffs, whereby my code can call $EDITOR,
>    wait for it to exit, and then pick up the file from /tmp, or
>    wherever.

Umm.  system, fork, exec, backticks....

>
>I can call external widgets if necessary, but system and shell
>portability would be swell, as I'm developing with tcsh/Mac OS X and
>deploying with bash under FreeBSD.  I've been poking through CPAN and
>various O'Reilly titles, but either the topic is too cozy a niche, or
>I'm not going about the search properly.
>
>Any suggestions or pointers would be appreciated.

There are no pointers in perl, and even 'The More than One True Way 
to Do it In Perl' is just a suggestion... ;-)

Hope this helps in any small way.

-Jeff Lowrey

Reply via email to