@@ -6,4 +6,35 @@ Command Line Applications
66Clint
77-----
88
9- .. todo :: Write about Clint
9+ .. todo :: Write about Clint
10+
11+ commando
12+ --------
13+ `commando <https://github.com/lakshmivyas/commando >`_ - argparse in style
14+
15+ A simple wrapper for argparse that allows commands and arguments to be
16+ defined declaratively using decorators. Note that this does not support
17+ all the features of argparse yet.
18+
19+ With commando:
20+
21+ .. code-block :: python
22+
23+ class Engine (Application ):
24+
25+ @command (description = ' hyde - a python static website generator' ,
26+ epilog = ' Use %(prog)s {command} -h to get help on individual commands' )
27+ @param (' -v' , ' --version' , action = ' version' , version = ' %(prog)s ' + __version__ )
28+ @param (' -s' , ' --sitepath' , action = ' store' , default = ' .' , help = " Location of the hyde site" )
29+ def main (self , params ): pass
30+
31+ @subcommand (' init' , help = ' Create a new hyde site' )
32+ @param (' -t' , ' --template' , action = ' store' , default = ' basic' , dest = ' template' ,
33+ help = ' Overwrite the current site if it exists' )
34+ @param (' -f' , ' --force' , action = ' store_true' , default = False , dest = ' overwrite' ,
35+ help = ' Overwrite the current site if it exists' )
36+ def init (self , params ):
37+ print params.sitepath
38+ print params.template
39+ print params.overwrite
40+
0 commit comments