Use actual options names when guessing usage
authorAlexander Solovyov <piranha@piranha.org.ua>
Tue, 04 Aug 2009 17:04:08 +0300
changeset 69 bf6cd5a1fc9e
parent 68 36ce7dcfe7c0
child 70 74b690e79606
Use actual options names when guessing usage
finaloption.py
--- a/finaloption.py	Mon Aug 03 20:38:06 2009 +0300
+++ b/finaloption.py	Tue Aug 04 17:04:08 2009 +0300
@@ -404,11 +404,11 @@
     args, varargs = inspect.getargspec(func)[:2]
     argnum = len(args) - len(options)
     if argnum > 0:
-        usage += 'ARGUMENT'
+        usage += args[0].upper()
         if argnum > 1:
             usage += 'S'
     elif varargs:
-        usage += '[ARGUMENTS]'
+        usage += '[%s]' % varargs.upper()
     return usage
 
 def catcher(target, help_func):