Wed 14 Sep 2011 08:49:32 AM UTC, original submission:
Marking options as multiple allows one to write
--foo bar --foo baz
and to access the arguments given to the multi-option foo conveniently through an array. Very intuitively, by default, you can also write:
--foo bar,baz
which is great behaviour in 99% of the cases, and which I call condensing here. However, sometimes it's nice to have `multiple' options but no condensing, and instead let the user tokenise the strings if need be.
For instance multiple printf(-like) specs, which (to correspond closely to intuitive behaviour) should not have escaped commas in them, e.g.
--format "%d, %d" --format "%u, %u"
I suggest to declare that as follows:
option "format" f "printf-like spec" string optional multiple condense=no
where the keyword `condense' is only meaningful in conjunction with the `multiple' keyword and can take `yes' and `no' as values, where `yes' is the default.
Omitting the `condense' clause results in default behaviour, i.e. condense is implicitly `yes'.
|