suppress one of the options from help when using optparse in python -


consider following:

parser.add_option("-f", "--file", "--secret", action = "append", type = "string", dest = "filename", default = [], = "specify files") 

i hide --secret option user when invoked. can in following way?

parser.add_option("-f", "--file", action = "append", type = "string", dest = "filename", default = [], = "specify files") parser.add_option("--secret", action = "append", type = "string", dest = "filename", default = [], = "specify files") 

am missing hidden issue doing so?if so, can suggest alternative way achieve this.

try help=suppress_help trick (see docs):

from optparse import optionparser, suppress_help  parser.add_option("-f", "--file", action = "append", type = "string", dest = "filename", default = [], = "specify files") parser.add_option("--secret", action = "append", type = "string", dest = "filename", default = [], help=suppress_help) 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -