Skip to content

Instantly share code, notes, and snippets.

@shimizukawa
Created June 9, 2012 03:12
Show Gist options
  • Save shimizukawa/2899220 to your computer and use it in GitHub Desktop.
Save shimizukawa/2899220 to your computer and use it in GitHub Desktop.
clime sample code
def foo(name, age=10):
print "{0} is {1} years old.".format(name, age)
import clime.now # this NEED to place here
(env1) D:\env1>python foo.py
foo.py: foo() takes at least 1 argument (1 given)
(env1) D:\env1>python foo.py --help
usage: [--age] NAME
or: foo [--age] NAME
(env1) D:\env1>python foo.py xaxtsuxo
xaxtsuxo is 10 years old.
(env1) D:\env1>python foo.py --age 90
foo.py: foo() takes at least 1 argument (1 given)
(env1) D:\env1>python foo.py xaxtsuxo --age 90
xaxtsuxo is 90 years old.
(env1) D:\env1>python foo.py foo --age 90
foo.py: foo() takes at least 1 argument (1 given)
(env1) D:\env1>python foo.py foo bar --age 90
bar is 90 years old.
(env1) D:\env1>python foo.py bar --age 90
bar is 90 years old.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment