Command Line interface in pYthon
Overview
CLY is a Python module for simplifying the creation of interactive shells. Kind of like the builtin cmd module on steroids.
It has the following features:
- Tab completion of all commands.
- Contextual help.
- Extensible grammar - you can define your own commands with full dynamic completion, contextual help, and so on.
- Simple. Grammars are constructed from objects using a convenient function-like syntax.
- Grammars can also be defined in XML, facilitating a more data-driven approach.
- Flexible command grouping and ordering.
- Grammar parser, including completion and help enumeration, can be used independently of the readline-based shell. This allows CLY's parser to be used in other environments (think web-based shell ;))
- Lots of other cool stuff.
Bugs?
Please check existing bugs first in case your issue has already been reported.
If it hasn't proceed create a new ticket.
Installation
Normal Python package installation procedures apply:
# python setup.py build # python setup.py build_ext -i # python setup.py test # python setup.py install
This will compile, test and install CLY and the CLY Readline extensions.
Documentation
I suggest talking a walk through the tutorial first, then refer to the documentation index for more information.
Download
Latest stable versions can be downloaded from the Cheese Shop.
Download a ZIP of trunk from here, browse the code, or check out the source with Subversion:
svn co http://swapoff.org/svn/cly/trunk cly
Change Log
[582] by athomas on 07/21/2008 12:27:05 AM
cull_candidates() can be chained.
[581] by athomas on 07/21/2008 12:15:23 AM
Export builder.cull_candidates() through __all__.
[580] by athomas on 07/21/2008 12:11:11 AM
Removed reference to cly.extra.
[579] by athomas on 07/21/2008 12:06:37 AM
Automatically cull candidates by default. This can be disabled with cull_candidates=False.
[578] by athomas on 07/20/2008 10:46:52 PM
Allow help() to return bare strings. These will be auto-formatted is possible.
[577] by athomas on 07/20/2008 10:46:47 PM
Use "graft" attribute of <grammar> root element if available.
