Fix doc generation with overridden argument names.

This commit is contained in:
Florian Bruhin 2014-09-15 00:03:39 +02:00
parent 4d3b3616a6
commit f2e68685d2
2 changed files with 4 additions and 4 deletions

View File

@ -324,10 +324,10 @@ class register: # pylint: disable=invalid-name
short_flag = '-{}'.format(shortname)
args.append(long_flag)
args.append(short_flag)
self.opt_args[name] = long_flag, short_flag
self.opt_args[param.name] = long_flag, short_flag
else:
args.append(name)
self.pos_args.append(name)
self.pos_args.append((param.name, name))
kwargs.update(annotation_info.kwargs)
return args, kwargs

View File

@ -162,9 +162,9 @@ def _get_command_doc(name, cmd):
if cmd.pos_args:
output.append("")
output.append("==== positional arguments")
for arg in cmd.pos_args:
for arg, name in cmd.pos_args:
try:
output.append("* +'{}'+: {}".format(arg,
output.append("* +'{}'+: {}".format(name,
parser.arg_descs[arg]))
except KeyError as e:
raise KeyError("No description for arg {} of command "