mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
explain key=value argument parsing failures (#910)
This commit is contained in:
@ -303,6 +303,13 @@ class Builder:
|
|||||||
) -> None:
|
) -> None:
|
||||||
if values is None:
|
if values is None:
|
||||||
return
|
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] = {
|
as_dict: Dict[str, str] = {
|
||||||
key_arg(k): val_arg(v) for k, v in (x.split("=", 1) for x in values)
|
key_arg(k): val_arg(v) for k, v in (x.split("=", 1) for x in values)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user