Re: optional arguments; compact reporting
Tobias Herp <[email protected]> Sat, 29 Dec 2007 11:44:40 +0100
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
Alexy Khrabrov schrieb: > I wonder how do you implement optional arguments to Optik. I.e., you > can have an option > > -P [file] > > ... > > How do we do optional values in Optik, with nargs <= 1? I reckon you need to use a callback function; but sorry, I didn't do something like that yet... > Another question I have it how can I output a docstring right from > the parser.add_option() block? I prefer to define all option-related > things in the same block once. I'd like to output the help value >>from the block, or append it to a report. I'm not sure what you mean. You could put the string in a variable which you use in the add_option(..., help='bla...') argument. Hth, -- Tobias ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/