From: Bernd S. <ber...@in...> - 2007-09-30 19:52:46
|
On Sun, 30 Sep 2007 19:10:33 +0200, Colin Adams = <col...@ho...> wrote: > It sounds to me like the two should be equivalent. Certainly I do not = = > need a list of lists. But I suppose if people were to supply multiple = = > uses of an AP_STRING_LIST_OPTION, then this ought to be a list of list= s. = > Is it possible to configure an option as not allowing repeats? Hi Colin, I have just added the possibility to specify a `maximum_occurrences' for= = options. A value of "0" means that there is no upper limit. If you want = an = option to be given just once, calling "o.set_maximum_occurrences (1)" = should be sufficient now. About your comma-seperated list of arguments, I am currently thinking = about an elegant way to integrate this into the library. If you have a = good solution, just go forward. I am thinking about adding an optional = 'split character' to AP_OPTION_WITH_PARAMETER that make '--foo=3Dx,y' = equivalent to '--foo=3Dx --foo=3Dy'. Also, I have strengthend the preconditions for parsing, and now you shou= ld = have a contract violation if you add "two options with the same short or= = long form" (it is a little more complicated with alternative options = lists). The tag of the exception is currently 'valid_options', which is = = not too good, but difficult to change. Bernd PS: Thanks for helping me to improve the library. PPS: I still have the request open to have `mutually exclusive options',= = but I have not found a good solution yet. |