Skip to content

Commit

Permalink
Add short -N alias for --no-reuse-existing-virtualenvs (#639)
Browse files Browse the repository at this point in the history
* Add short -nr alias for --no-reuse-existing-virtualenvs

* Run black

* Change short command to -N

* Fix shortcut
  • Loading branch information
johnthagen committed Aug 4, 2022
1 parent 5eecc52 commit fb5196b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nox/_option_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def flag_pair_merge_func(
def make_flag_pair(
name: str,
enable_flags: tuple[str, str] | tuple[str],
disable_flags: tuple[str],
disable_flags: tuple[str, str] | tuple[str],
default: bool = False,
**kwargs: Any,
) -> tuple[Option, Option]:
Expand Down
5 changes: 4 additions & 1 deletion nox/_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@ def _session_completer(
*_option_set.make_flag_pair(
"reuse_existing_virtualenvs",
("-r", "--reuse-existing-virtualenvs"),
("--no-reuse-existing-virtualenvs",),
(
"-N",
"--no-reuse-existing-virtualenvs",
),
group=options.groups["environment"],
help="Re-use existing virtualenvs instead of recreating them.",
),
Expand Down

0 comments on commit fb5196b

Please sign in to comment.