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 upHelp does not work with all argparse wrapped functions #515
Comments
|
Since this Issue and #522 are vaguely related, it might be good to work them together. |
|
I just want to summarize the items from this issue as well as #522 and #523 so everyone is in agreement about what the desired behavior.
Does that summarize everything? |
|
That does a good job of summarizing my understanding for the desired behavior as it relates to the three Issues you mention. |
|
|
I’m also OK with Kevin’s interpretation. I just want all features to work correctly as documented. If there are exceptions and/or gotchas, we need to make that abundantly clear in the documentation and examples. |
|
Let me clarify my comments about #522. Calling it bad code is harsh. I only mean to caution that it can introduce unpredictability. Here is an example based on things I do in my own application. Let's say I have a function called |
|
|
#523 - This one may cause an issue if a user types |
For an
argparsecommand, the help function adds '-h' to the command to print help text. For most cases, this approach works. However, there are cases in which '-h' won't be available because the ArgumentParser hasadd_helpset to False.The help function needs to be updated to do something similar to the argparse_completer module. It's able to process a line of text and figure out what parser or subparser is active. When it identifies the parser it can just call
parser.print_help().