-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Using this minimal example of a Python-fire CLI:
import fire
def f(my_arg):
print(my_arg)
fire.Fire(my_arg)This is the result I get:
➜ ~ python example.py --my-arg=hello
hello
➜ ~ python example.py --myarg=hello
--myarg=helloAs you can see, a typo in the argument leads to unexpected behaviour, which can be really hard to debug.
I would suggest never treating an argument matching --[a-zA-Z0-9_-]+ as positional, without some sort of escaping by the user (perhaps similar to the escaping you require to avoid parsing ints, etc.).
Reactions are currently unavailable