--- a/opster.py Thu Jan 06 20:34:09 2011 +0100
+++ b/opster.py Sun Jan 23 18:02:33 2011 +0100
@@ -182,8 +182,8 @@
if shortlist and not cmd.startswith('^'):
continue # short help contains only marked commands
cmd = cmd.lstrip('^~')
- doc = info[0].__doc__.strip() or '(no help text available)'
- hlp[cmd] = doc.splitlines()[0].rstrip()
+ doc = info[0].__doc__ or '(no help text available)'
+ hlp[cmd] = doc.strip().splitlines()[0].rstrip()
hlplist = sorted(hlp)
maxlen = max(map(len, hlplist))
--- a/tests/multicommands.py Thu Jan 06 20:34:09 2011 +0100
+++ b/tests/multicommands.py Sun Jan 23 18:02:33 2011 +0100
@@ -38,6 +38,10 @@
if opts.get('exit'):
sys.exit(opts['exit'])
+@command(shortlist=True)
+def nodoc():
+ pass
+
def ui_middleware(func):
def extract_dict(source, *keys):
dest = {}
--- a/tests/opster.t Thu Jan 06 20:34:09 2011 +0100
+++ b/tests/opster.t Sun Jan 23 18:02:33 2011 +0100
@@ -31,6 +31,7 @@
commands:
+ nodoc (no help text available)
simple Just simple command to print keys of received arguments.