jp (base): add --max option:
when MULTI_ITEMS is set, --max options is automatically added, except if NO_MAX flag is set.
This commit is contained in:
parent
b7e2de70d7
commit
d2dadbaf46
1 changed files with 5 additions and 3 deletions
|
|
@ -353,6 +353,9 @@ class Jp(object):
|
|||
elif flags.multi_items:
|
||||
# mutiple items
|
||||
pubsub_group.add_argument("-i", "--item", type=unicode_decoder, action='append', dest='items', default=[], help=_(u"items to retrieve (DEFAULT: all)"))
|
||||
if not flags.no_max:
|
||||
pubsub_group.add_argument("-m", "--max", type=int, default=10,
|
||||
help=_(u"maximum number of items to get ({no_limit} to get all items)".format(no_limit=C.NO_LIMIT)))
|
||||
|
||||
if flags:
|
||||
raise exceptions.InternalError('unknowns flags: {flags}'.format(flags=u', '.join(flags)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue