From 72cde5a57dcd087c32596f16fe40df2a109799a2 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 16 Apr 2020 11:24:15 +0200 Subject: [PATCH] core: disallow parsing options after command (fixes #951) --- core/emu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/emu.py b/core/emu.py index 236009eec7..542c9edfd8 100755 --- a/core/emu.py +++ b/core/emu.py @@ -79,7 +79,9 @@ def _from_env(name): return os.environ.get(name) == "1" -@click.command(context_settings=dict(ignore_unknown_options=True)) +@click.command( + context_settings=dict(ignore_unknown_options=True, allow_interspersed_args=False) +) # fmt: off @click.option("-a", "--disable-animation/--enable-animation", default=_from_env("TREZOR_DISABLE_ANIMATION"), help="Disable animation") @click.option("-c", "--command", "run_command", is_flag=True, help="Run command while emulator is running")