[Tutor] python CLI parser

Martin Marcher martin at marcher.name
Fri Dec 21 17:18:50 CET 2007


could you have a short review of my CLI package.

What it provides is a simple interface to create a "shell". I'll be
using it inside a bot I'm writing to manage it.

 * pluggable commands
 * works over streams instead of stdin/stdout/stderr so it should be
network aware (right?)

 * not documented at all, right now

Todos (for me of course, not for you, but open to suggestions):
 * import readline
 * provide <TAB> completion
 * make "CTRL+d" also a quitcommand
 * remove hardcoded quitCommands only provide defaults

Necessary interface for a command:
function(*args) returning a string (No smart output of dicts, list or suche yet)

Builtin commands are noop and and echo.

To run it do "python main.py"
To leave it use "quit" or "exit"

any comments are welcome, especially how I could make CTRL+d leave my "shell"

and I'm not looking at something that provides, I'm pretty sure
someone did a similiar thing already :)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cli.tar.bz2
Type: application/x-bzip2
Size: 2929 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20071221/12e6812e/attachment-0001.bin 

More information about the Tutor mailing list