You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I accidentally misspell the run_encoding argument, I get behavior that can be really confusing to debug (e.g., if that's a relative file path, you suddenly get a --mypath=1 directory):
I assume this happens because fire fills in all the keyword args and then assumes you specify positional arguments after them?
What I wish happened instead is that, unless explicitly quoted, any argument starting with -- would be treated as a keyword arg, so you'd see:
1. Initial component
2. Accessed property "myfunction"
3. ('The function received no value for the required argument:', 'run_encoding')
Type: function
String form: <function myfunction at 0x110138cf8>
File: /Users/jtratner/fire_example.py
Line: 3
Usage: fire_example.py myfunction ARG1 ARG2 RUN_ENCODING
fire_example.py myfunction --arg1 ARG1 --arg2 ARG2 --run-encoding RUN_ENCODING
This is related to the issue in #25, in that if positional arguments were not allowed after keyword arguments, you wouldn't end up with the ambiguity, but I can see how that's less "shell like".
The text was updated successfully, but these errors were encountered:
Let's say I have some function like this:
If I accidentally misspell the run_encoding argument, I get behavior that can be really confusing to debug (e.g., if that's a relative file path, you suddenly get a
--mypath=1
directory):I assume this happens because fire fills in all the keyword args and then assumes you specify positional arguments after them?
What I wish happened instead is that, unless explicitly quoted, any argument starting with
--
would be treated as a keyword arg, so you'd see:This is related to the issue in #25, in that if positional arguments were not allowed after keyword arguments, you wouldn't end up with the ambiguity, but I can see how that's less "shell like".
The text was updated successfully, but these errors were encountered: