Closed dhulke closed 4 years ago
debug
option was only used internally for tests (whence the name "debug")
It's deprecated for now, overriding ArgumentParser.prototype.exit
is the better way of approaching this issue (for now, until python devs fix exit_on_error
option).
See also https://github.com/nodeca/argparse/issues/113#issuecomment-674118326
While trying to do unit testing with a library that uses argparse, I found out that it would exit the test when an error was found. The only solution I found online was on this python SO thread.
I was able to reproduce the solution in node with the following code:
Afterwards, out of curiosity I decided to go through the code and found out that it was checking for a debug variable and also that it already had this documented in a large comment describing all argparse options at the beginning of the code.
So would it be ok if a sent a PR copying the description for the debug option from the code to the readme?