Fix doc generation with overridden argument names.
This commit is contained in:
parent
4d3b3616a6
commit
f2e68685d2
@ -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
|
||||
|
||||
|
@ -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 "
|
||||
|
Loading…
Reference in New Issue
Block a user