public
Description: Syntactic sugar for creating Python command line scripts by introspecting a function definition
Homepage: http://simonwillison.net/2009/May/28/optfunc/
Clone URL: git://github.com/simonw/optfunc.git
optfunc / subcommands_demo.py
100755 14 lines (9 sloc) 0.197 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
import optfunc
 
def one(arg):
    print "One: %s" % arg
 
def two(arg):
    print "Two: %s" % arg
 
def three(arg):
    print "Three: %s" % arg
 
optfunc.main([one, two, three])