comparison README.txt @ 18:b7489d3f838e

more readme correction, now in function def
author catherine@localhost
date Thu, 15 May 2008 13:43:54 -0400
parents f81b5670a713
children 1899088dd95d
comparison
equal deleted inserted replaced
17:f81b5670a713 18:b7489d3f838e
46 - Parsing commands with `optparse` options (flags) 46 - Parsing commands with `optparse` options (flags)
47 47
48 :: 48 ::
49 49
50 @options([make_option('-m', '--myoption', action="store_true", help="all about my option")]) 50 @options([make_option('-m', '--myoption', action="store_true", help="all about my option")])
51 def myfunc(self, arg): 51 def myfunc(self, arg, opts):
52 ... 52 if opts.myoption:
53 ...
53 54
54 See Python standard library's `optparse` documentation: http://docs.python.org/lib/optparse-defining-options.html 55 See Python standard library's `optparse` documentation: http://docs.python.org/lib/optparse-defining-options.html
55 56
56 - Catherine Devlin, catherinedevlin.blogspot.com 57 - Catherine Devlin, http://catherinedevlin.blogspot.com
57 58
58 cmd2 can be installed with `easy_install cmd2` 59 cmd2 can be installed with `easy_install cmd2`
59 60
60 Cheese Shop page: http://pypi.python.org/pypi/cmd2 61 Cheese Shop page: http://pypi.python.org/pypi/cmd2
61 62