On Mon, Nov 9, 2009 at 12:00 AM, Vladimir Prus
Yang Zhang wrote:
Is there an example of using program_options to build a hierarchical options parser (a la svn, apt-get, git, etc.), in which earlier options select parsers for later options?
SVN option parsing do not, in fact, select parsers for later options. There's a single global set of options, it's just the first positional token that is taken to mean 'command', and for each command, and additional check is performed that only options that are relevant for that command are specified. Such check has to be done manually with the current version of program_options -- but does not seem a hard thing to do.
Then forget svn and consider git. I was just pulling an arbitrary example; the particular example wasn't the focus. The question remains. -- Yang Zhang http://www.mit.edu/~y_z/