diff --git a/CHANGES.md b/CHANGES.md index 67fab457844..8b1801d16d2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,9 @@ ones in. --> ### Fixes +[#5349](https://github.com/cylc/cylc-flow/pull/5349) - Bugfix: `cylc vip --workflow-name` +only worked when used with a space, not an `=`. + [#5367](https://github.com/cylc/cylc-flow/pull/5367) - Enable using Rose options (`-O`, `-S` & `-D`) with `cylc view`. diff --git a/cylc/flow/option_parsers.py b/cylc/flow/option_parsers.py index e9145010b75..3a0ea9d6212 100644 --- a/cylc/flow/option_parsers.py +++ b/cylc/flow/option_parsers.py @@ -821,6 +821,7 @@ def cleanup_sysargv( for x in compound_script_opts } # Filter out non-cylc-play options. + args = [i.split('=')[0] for i in sys.argv] for unwanted_opt in (set(options.__dict__)) - set(script_opts_by_dest): for arg in compound_opts_by_dest[unwanted_opt].args: if arg in sys.argv: @@ -831,6 +832,9 @@ def cleanup_sysargv( not in ['store_true', 'store_false'] ): sys.argv.pop(index) + elif arg in args: + index = args.index(arg) + sys.argv.pop(index) # replace compound script name: sys.argv[1] = script_name diff --git a/tests/unit/test_option_parsers.py b/tests/unit/test_option_parsers.py index 332851d34c4..e3831a1daea 100644 --- a/tests/unit/test_option_parsers.py +++ b/tests/unit/test_option_parsers.py @@ -397,6 +397,19 @@ def test_combine_options(inputs, expect): 'play --foo something myworkflow'.split(), id='no path given' ), + param( + 'vip --bar=something'.split(), + { + 'script_name': 'play', + 'workflow_id': 'myworkflow', + 'compound_script_opts': [ + OptionSettings(['--bar', '-b'])], + 'script_opts': [], + 'source': './myworkflow', + }, + 'play myworkflow'.split(), + id='removes --key=value' + ), ] ) def test_cleanup_sysargv(monkeypatch, argv_before, kwargs, expect):