Mercurial > hg > CommandParser
diff tests/simpleexample.py @ 12:e0a3148e67a8
bug fix and a short overhaul of documentation
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 28 Jan 2013 19:54:36 -0800 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/simpleexample.py Mon Jan 28 19:54:36 2013 -0800 @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +class Foo(object): + """silly class that does nothing""" + def __init__(self): pass + def foo(self, value): + print "The value is %s" % value + def bar(self, fleem, verbose=False): + """ + The good ole `bar` command + - fleem: you know, that thing fleem + - verbose: whether to print out more things or not + """ + if verbose: + print "You gave fleem=%s" % fleem + return fleem * 2 + +import commandparser +parser = commandparser.CommandParser(Foo) +parser.invoke()