Added proper CLI logic for parameters of general type

We just run a Python eval.

Resolves https://github.com/moonstream-to/moonworm/issues/112
pull/113/head
Neeraj Kashyap 2023-08-08 15:39:51 -07:00
rodzic 1fffc52ad3
commit 0567ce0893
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -831,6 +831,15 @@ def generate_cli_generator(
value=cst.parse_expression("eval"),
),
)
else:
# In general case, we just use a Python `eval` to parse the input from the command line.
# This is similar to the way we handle `tuple` arguments.
call_args.append(
cst.Arg(
keyword=cst.Name(value="type"),
value=cst.parse_expression("eval"),
),
)
add_argument_call = cst.Call(
func=cst.Attribute(