[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2020-12-11 Thread paul j3
paul j3 added the comment: In the subparser example, it's the `build` subparser that puts '--overwritte' in the unrecognized list. That is then passed back to the main parser, which then issues the 'unrecognized' error, along with its own usage. The subparser is called with

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2020-12-11 Thread conchylicultor
conchylicultor added the comment: I don't think this should have been closed. [1] If the user is using sub_parser, the options are not even displayed. For example in our https://github.com/tensorflow/datasets project: ``` $ tfds build mnist --overwritte usage: tfds [-h] [--helpfull]

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2019-12-25 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the feedback. Closing it as rejected. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2019-12-25 Thread hai shi
hai shi added the comment: I checked some other common clis and it is show all right available options too. So I thought the argparse's help function is good enough too ;) ``` $ ps -etest error: TTY could not be found Usage: ps [options] Try 'ps --help ' or 'ps --help ' for additional

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2019-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: -1 Given an unknown argument, we really can't know what the user intended. The usage string already lists all available options and -h --help gives more detail when requested. -- ___ Python tracker

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2019-12-20 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : I came across this idea while working on error messages for click at https://github.com/pallets/click/issues/1446. Currently for unknown arguments which could in some case be typos argparse throws an error but doesn't make any suggestions. It