Re: Args with multiple identical keywords
Eddie Kohler <[email protected]> Mon, 30 Jul 2012 13:37:04 -0400
| Newsgroups | gmane.network.routing.click |
|---|---|
| Message-ID | <CAF0C5S+DYCP=Pj_Ag_Po1BZeNOq_8+yGi9jzQDRcfCQy=5DQcg@mail.gmail.com> |
Yes, try Args::read_all_with(). Eddie On Mon, Jul 30, 2012 at 7:35 AM, Sascha Alexander Jopen <[email protected]> wrote: > Hey, > > is it possible to parse argument lists containing the same keyword > multiple times, having each occurence of the keyword values assigned to > another variable? > > For example, would like to parse a configuration like this: > > SomeElement(FIRSTKEYWORD 1, FIRSTKEYWORD 2, ..., SECONDKEYWORD a, > SECONDKEYWORD b, ...); > > Currently only the last value of a keyword group is parsed and returned > as a result after consume() and all additional identical keyword > arguments are removed from the configuration string. > > The only solution i see so far is having a single keyword and > concatenating all values into a single argument to this keyword. This > keyword is then parsed as a string, splitting the string and passing the > parts to additional argument parsers of the right type. > > Does anybody know a better solution, which can directly be handled by > the argument parser? > > Regards, > Sascha > _______________________________________________ > click mailing list > [email protected] > https://amsterdam.lcs.mit.edu/mailman/listinfo/click