Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
explain key=value argument parsing failures (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored May 21, 2021
1 parent a4bb670 commit e7197f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cli/onefuzz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit e7197f1

Please sign in to comment.