Is there a way to leave an argument from the help using python argparse

I have an argument that is an internal debugging flag and should not be triggered by users who do not know what they are doing. I understand that to hide this, in fact, is security from obscurity, but I do not care about viciousness as incompetence. Optparse had the SUPPRESS_HELP parameter, is there an argparse equivalent?

+6
source share
1 answer
parser.add_argument('--secret', help=argparse.SUPPRESS) 

From here: http://argparse.googlecode.com/svn/trunk/doc/argparse-vs-optparse.html

The first Google result for argparse suppress_help , by the way.

+13
source

Source: https://habr.com/ru/post/895297/


All Articles