diff --git a/qutebrowser/commands/cmdutils.py b/qutebrowser/commands/cmdutils.py index 771819cff..8a364849a 100644 --- a/qutebrowser/commands/cmdutils.py +++ b/qutebrowser/commands/cmdutils.py @@ -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 diff --git a/scripts/generate_doc.py b/scripts/generate_doc.py index c292e45fd..1ee3f400b 100755 --- a/scripts/generate_doc.py +++ b/scripts/generate_doc.py @@ -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 "