diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-11-30 15:37:21 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-11-30 15:40:31 -0500 |
commit | 50f35039e7df321a309ee45db57d37635bf53ce3 (patch) | |
tree | d621f84ca974a4c1ac4e8a504416a671d9890b09 /mesonbuild/mdevenv.py | |
parent | a0514a7c4183a9e42d436865087d2f887d658d54 (diff) | |
download | meson-50f35039e7df321a309ee45db57d37635bf53ce3.zip meson-50f35039e7df321a309ee45db57d37635bf53ce3.tar.gz meson-50f35039e7df321a309ee45db57d37635bf53ce3.tar.bz2 |
devenv: avoid overwriting internal variables of the global argparse
We already use options.command for the subcommand in use, in this case
devenv. We cannot reuse that variable name for the list of words to
execute inside the devenv.
Diffstat (limited to 'mesonbuild/mdevenv.py')
-rw-r--r-- | mesonbuild/mdevenv.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/mdevenv.py b/mesonbuild/mdevenv.py index 2fb7904..b75d18b 100644 --- a/mesonbuild/mdevenv.py +++ b/mesonbuild/mdevenv.py @@ -20,7 +20,7 @@ def add_arguments(parser: argparse.ArgumentParser) -> None: help='Directory to cd into before running') parser.add_argument('--dump', action='store_true', help='Only print required environment (Since 0.62.0)') - parser.add_argument('command', nargs=argparse.REMAINDER, + parser.add_argument('devcmd', nargs=argparse.REMAINDER, metavar='command', help='Command to run in developer environment (default: interactive shell)') def get_windows_shell() -> T.Optional[str]: @@ -131,7 +131,7 @@ def run(options: argparse.Namespace) -> int: devenv, varnames = get_env(b) if options.dump: - if options.command: + if options.devcmd: raise MesonException('--dump option does not allow running other command.') for name in varnames: print(f'{name}={quote_arg(devenv[name])}') @@ -143,7 +143,7 @@ def run(options: argparse.Namespace) -> int: setup_vsenv(b.need_vsenv) - args = options.command + args = options.devcmd if not args: prompt_prefix = f'[{b.project_name}]' shell_env = os.environ.get("SHELL") |