Default argument for an option?
Thorsten Kampe <[email protected]> Sun, 26 Sep 2004 20:01:00 +0200
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
This has probably been asked before but I couldn't find the answer:
is it possible to have a default argument for a switch?
I have this code:
add_option('-g',
'--guistyle',
action = 'store',
dest = 'guistyle',
metavar = 'STYLE',
nargs = 1,
type = 'string',
help = 'graphical output (STYLE = none|gnome|kde|windows)')
I would like this option argument default to 'none' (which means use
Tcl/Tk EasyGui) so it would be possible to use it like
foobar --guistyle none
and
foobar --guistyle
The option itself shouldn't default to "--guistyle none"; only if
--guistyle is given on the command line.
Is this possible with Optik?
Thorsten
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php