PR#645: don't fail on CLI plugins without docstrings
Merges #645 https://pagure.io/koji/pull-request/645 Fixes: #644 https://pagure.io/koji/issue/644 CLI fails on plugins without docstrings
This commit is contained in:
commit
c3a0b4673e
2 changed files with 2 additions and 1 deletions
2
cli/koji
2
cli/koji
|
|
@ -275,7 +275,7 @@ def list_commands(categories_chosen=None):
|
|||
for category in categories_chosen:
|
||||
print(_("\n%s:" % categories[category]))
|
||||
for alias,handler in handlers:
|
||||
desc = handler.__doc__
|
||||
desc = handler.__doc__ or ''
|
||||
if desc.startswith('[%s] ' % category):
|
||||
desc = desc[len('[%s] ' % category):]
|
||||
elif category != 'misc' or desc.startswith('['):
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ Most simple command would look like this:
|
|||
|
||||
@export_cli
|
||||
def anon_handle_echo(options, session, args):
|
||||
"[info] Print arguments"
|
||||
usage = _("usage: %prog echo <message>")
|
||||
parser = OptionParser(usage=usage)
|
||||
(opts, args) = parser.parse_args(args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue