respect empty strings as usage
authorAlexander Solovyov <piranha@piranha.org.ua>
Thu, 03 Sep 2009 23:20:02 +0300
changeset 84 8f828d323b3d
parent 83 cf70fd773191
child 85 baa6caa786af
respect empty strings as usage
opster.py
--- a/opster.py	Thu Sep 03 23:19:29 2009 +0300
+++ b/opster.py	Thu Sep 03 23:20:02 2009 +0300
@@ -44,8 +44,11 @@
             # no options supplied and no options present in func
             options_ = []
 
-        usage_ = usage or guess_usage(func, options_)
         name_ = name or func.__name__.replace('_', '-')
+        if usage is None:
+            usage_ = guess_options
+        else:
+            usage_ = usage
         prefix = hide and '~' or (shortlist and '^' or '')
         CMDTABLE[prefix + name_] = (func, options_, usage_)