From fb5196b03081434dc61c432a61ebf33e79c2cf16 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Thu, 4 Aug 2022 15:24:10 -0400 Subject: [PATCH] Add short -N alias for --no-reuse-existing-virtualenvs (#639) * Add short -nr alias for --no-reuse-existing-virtualenvs * Run black * Change short command to -N * Fix shortcut --- nox/_option_set.py | 2 +- nox/_options.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nox/_option_set.py b/nox/_option_set.py index 0ffcc9d9..26014117 100644 --- a/nox/_option_set.py +++ b/nox/_option_set.py @@ -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]: diff --git a/nox/_options.py b/nox/_options.py index 4f6b3ad7..4129c32d 100644 --- a/nox/_options.py +++ b/nox/_options.py @@ -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.", ),