summaryrefslogtreecommitdiff
path: root/cmd2/argparse_custom.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/argparse_custom.py')
-rw-r--r--cmd2/argparse_custom.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py
index 9e6805aa..1cdb7840 100644
--- a/cmd2/argparse_custom.py
+++ b/cmd2/argparse_custom.py
@@ -625,6 +625,8 @@ class Cmd2HelpFormatter(argparse.RawTextHelpFormatter):
result = '[%s [...]]' % get_metavar(1)
elif action.nargs == ONE_OR_MORE:
result = '%s [...]' % get_metavar(1)
+ elif isinstance(action.nargs, int) and action.nargs > 1:
+ result = '{}{{{}}}'.format('%s' % get_metavar(1), action.nargs)
# End cmd2 customization
else:
result = super()._format_args(action, default_metavar)