Re: Silent help
Greg Ward <[email protected]> Sun, 24 Oct 2004 20:25:10 -0400
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
On 21 October 2004, John Coldrick said:
> 1. From what I can tell, documentation for customizing the '-h' output is
> sparse/terse. I don't have the time/expertise to figure out the code roght
> now, but is the above statement true? At least I can stop looking. :)
Correct. It's a wee bit better in Optik 1.5/Python 2.4, but still on
the terse side.
> 2. Part of my need for the above is to "hide" a few parameters from the user.
> My program can be called two ways - once by the user, and later by spawning
> processes in a cluster with their own params. I wanted to keep the code
> all-in-one, so right now I've clustered these "bad" params at the end of the
> help, with a header saying to not use them. I was able to at least figure
> that much out. :) However, is there a simple/quick way to tag certain
> params from showing up when the user enters 'foo.py -h'?
from optparse import OptionParser, SUPPRESS_HELP
[...]
parser.add_option("--secret",
help=SUPPRESS_HELP)
Damn-I-really-did-think-of-everything'ly,
Greg
--
Greg Ward <[email protected]> http://www.gerg.ca/
Dyslexics of the world, untie!
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl