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=hello
As 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.).
Using this minimal example of a Python-fire CLI:
This is the result I get:
As 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.).