Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFirst-character argument flag is undocumented and behaves strangely when colliding with default options #238
Labels
Comments
|
This would be easy enough to fix by adding a list of fire arguments here However, I didn't implement this fix since it would violate single source of truth (list of fire arguments defined in multiple places). If this is acceptable I can submit a pull request. Without the hard-coded list, the next easiest option I could see is propagating |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Consider the function signature:
After reading through the user guide for fire, I would expect
python myFile -hto produce the help signature for this file. However, it runs the script withheadless = True.While in retrospect I suppose this makes sense, I would like some way of telling fire to disallow shortcut flags if they override user-expected options like --[i]nteractive, --[h]elp, etc. In those cases, the user can be forced to say
python myFile --headlessfor the desired behavior.Moreover, if my script looked like this:
and I ran the same line of code, fire would appropriately err out. This is also acceptable in my opinion.
More importantly, the first-character flag behavior should at the very least be documented. I read through https://github.com/google/python-fire/blob/master/docs/guide.md and couldn't find it there.