From e7197f14070a5d248e6aa80f6e76d314a91c54e9 Mon Sep 17 00:00:00 2001 From: bmc-msft <41130664+bmc-msft@users.noreply.github.com> Date: Fri, 21 May 2021 13:44:34 -0400 Subject: [PATCH] explain key=value argument parsing failures (#910) --- src/cli/onefuzz/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cli/onefuzz/cli.py b/src/cli/onefuzz/cli.py index 07edb5c682..a7025200b0 100644 --- a/src/cli/onefuzz/cli.py +++ b/src/cli/onefuzz/cli.py @@ -303,6 +303,13 @@ def __call__( ) -> None: if values is None: return + + for arg in values: + if "=" not in arg: + raise argparse.ArgumentTypeError( + "unable to parse value as a key=value pair: %s" % repr(arg) + ) + as_dict: Dict[str, str] = { key_arg(k): val_arg(v) for k, v in (x.split("=", 1) for x in values) }