get original argv string(s) for program option?

Is it possible to index from option name to the original argv string(s) supplied by the user? It doesn't seem possible to do this with vm["option"].as<string>() since: 1. *template*<*typename* T> *const* T & as() *const*; If stored value if of type T, returns that value. Otherwise, throws boost::bad_any_cast exception. Now that I think of it, because options can come from environment vars and config files as well, the original string won't necessarily be lying around in memory, but would have to be copied somewhere. What would be nice is if variable_value could (yes, at some cost to those who don't use it) store the original string(s) automatically? The vector<option> from command_line_parser isn't convenient to use (since it can't be indexed by option name, but would have to be searched.

Jonathan Graehl wrote:
Is it possible to index from option name to the original argv string(s) supplied by the user?
It doesn't seem possible to do this with vm["option"].as<string>() since:
Right, it's not possible. Could you explain why it's needed? I don't mind adding features, just want to know the motivation before discussing them. Thanks, Volodya
participants (2)
-
Jonathan Graehl
-
Vladimir Prus