Adjust formatting for arg descriptions

This commit is contained in:
Florian Bruhin 2014-09-07 21:17:19 +02:00
parent 9e3f5e28bc
commit 04c77d4d90

View File

@ -159,7 +159,8 @@ def _get_command_doc(name, cmd):
output.append("==== positional arguments") output.append("==== positional arguments")
for arg in cmd.pos_args: for arg in cmd.pos_args:
try: try:
output.append('* +{}+: {}'.format(arg, parser.arg_descs[arg])) output.append("* +'{}'+: {}".format(arg,
parser.arg_descs[arg]))
except KeyError as e: except KeyError as e:
raise KeyError("No description for arg {} of command " raise KeyError("No description for arg {} of command "
"'{}'!".format(e, cmd.name)) "'{}'!".format(e, cmd.name))
@ -169,7 +170,7 @@ def _get_command_doc(name, cmd):
output.append("==== optional arguments") output.append("==== optional arguments")
for arg, (long_flag, short_flag) in cmd.opt_args.items(): for arg, (long_flag, short_flag) in cmd.opt_args.items():
try: try:
output.append('* +{}+, +{}+: {}'.format( output.append('* +*{}*+, +*{}*+: {}'.format(
short_flag, long_flag, parser.arg_descs[arg])) short_flag, long_flag, parser.arg_descs[arg]))
except KeyError: except KeyError:
raise KeyError("No description for arg {} of command " raise KeyError("No description for arg {} of command "