Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Aug 5, 2022
1 parent 6a7ba97 commit 0a964b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shtab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ def recurse(parser, prefix):
new_nargs,
) = recurse(
positional.choices[choice],
prefix + "_" + wordify(choice),
f"{prefix}_{wordify(choice)}",
)

sub_subparsers.extend(new_subparsers)
sub_option_strings.extend(new_option_strings)
sub_compgens.extend(new_compgens)
Expand Down Expand Up @@ -530,7 +531,7 @@ def recurse(parser, prefix, paths=None):
format_positional(opt) for opt in subparser._get_positional_actions()
if not isinstance(opt.choices, dict) if opt.help != SUPPRESS)

new_pref = prefix + "_" + wordify(cmd)
new_pref = f"{prefix}_{wordify(cmd)}"
options = all_commands[new_pref] = {
"cmd": cmd, "help": (subparser.description or "").strip().split("\n")[0],
"arguments": arguments, "paths": [*paths, cmd]}
Expand Down

0 comments on commit 0a964b3

Please sign in to comment.