View previous topic :: View next topic |
Author |
Message |
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Wed Oct 10, 2007 1:07 am Post subject: optional, with default value |
|
|
I want to have an argument that behaves in three different ways:
- if user omits the argument it does one thing
- if user provides a plain --argument it does another thing
- if user gives a value --argument=32 it does something else still
An example would be a --compression flag. If not specified, you get no compression. With just --compression you get a default compression level. With --compression=7 you get a specific compression level.
Any way to do that with ProgramOptions? |
|
Back to top |
|
|
aarti_pl
Joined: 25 Jul 2006 Posts: 28
|
Posted: Fri Oct 12, 2007 2:45 am Post subject: |
|
|
The problem with such a feature is that it will currently disallow using options with not-adjacent values.
E.g. you can write option with value:
--compression=6
or
--compression 6
Proper solution would be to add additional style for CommandLineStorage for such type of options, and reimplement parsers to follow choosen style. Styles probably need some more care anyway.
I will put it on my TODO list, as it will take more time to implement. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|