author | Dmitriy Morozov <dmitriy@mrzv.org> |
Fri, 03 Dec 2010 11:53:57 -0800 | |
changeset 144 | c66e1ada4c08 |
parent 123 | 4d73a8af4bbf |
child 158 | c3ab9c848675 |
permissions | -rw-r--r-- |
import pprint from opster import command @command(usage='[-l HOST] DIR') def another(dirname, listen=('l', 'localhost', 'ip to listen on'), port=('p', 8000, 'port to listen on'), daemonize=('d', False, 'daemonize process'), pid_file=('', '', 'name of file to write process ID to'), test=('t', lambda x: x or 'test', 'testing help for a function')): '''Command with option declaration as keyword arguments ''' pprint.pprint(locals()) if __name__ == '__main__': another()