changeset 12:b636cb715925

tested
author catherine@localhost
date Thu, 15 May 2008 12:42:01 -0400
parents 34107b79c840
children c6e8b645c0ab
files cmd2.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cmd2.py	Thu May 15 12:25:09 2008 -0400
+++ b/cmd2.py	Thu May 15 12:42:01 2008 -0400
@@ -43,8 +43,8 @@
         optionParser = OptionParser()
         for opt in option_list:
             optionParser.add_option(opt)
+        optionParser.set_usage("%s [options] arg" % func.__name__.strip('do_'))
         def newFunc(instance, arg):
-            optionParser.set_usage("%s [options] arg" % func.__name__)
             try:
                 opts, arg = optionParser.parse_args(arg.split())   
             except optparse.OptionValueError, e: