wxCmdLineParser - repeated options and parameters

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
arnoldemu
In need of some credit
In need of some credit
Posts: 7
Joined: Mon Dec 29, 2014 12:59 pm

wxCmdLineParser - repeated options and parameters

Post by arnoldemu »

Hi,

I hope somebody can help me.

I would like an option or a parameter to appear multiple times on the command-line for a program I am writing.
This is in addition to being able to give a list of files to operate on.

I am not sure wxCmdLineParser will support it.

1. I can define a parameter to appear multiple times on the command-line, and although I can define the name for the parameter in the wxCmdLineEntryDesc, and potentially have multiple parameters of different names, I can't see a way to identify them. There are only methods to find the number of parameters (no name can be specified to the function) and get each by index (no name can be specified to the function).

2. Alternatively I could define this using "option" type, however I don't see a function to get at the values for each option of the same name, if this was allowed.

Is there a way to do what i want without parsing the command-line mysel? is there any kind of iterator which i could use to look at each option or parameter and collect it's value? could i override the class and collect the options/parameters myself?

Thank you
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxCmdLineParser - repeated options and parameters

Post by PB »

I have never used it so it may not be what you need, i.e., be able to deal with multiple options with the same name but still: wxCmdLineArgs interface may be worth looking into, assuming you are using wxWdigets 3.1:
http://docs.wxwidgets.org/trunk/classwx ... e_arg.html
Post Reply