[program_options][1.35] validating string value

Hi, My option (say, "opt1") can take any of only few possible string type values (say, "value1", "value2", "value3" and "value4"). Is there anyway to specify this such that if any other value, say - "valueXX", is passed to "opt1", it throws an error? If yes, can someone point me to documentation or sample code snippet to show how to do this? Or, explicitly, checking against these possible values is my only option? Regards, ~ Soumen -- View this message in context: http://old.nabble.com/-program_options--1.35--validating-string-value-tp2762... Sent from the Boost - Users mailing list archive at Nabble.com.

AMDG Soumen wrote:
My option (say, "opt1") can take any of only few possible string type values (say, "value1", "value2", "value3" and "value4"). Is there anyway to specify this such that if any other value, say - "valueXX", is passed to "opt1", it throws an error?
If yes, can someone point me to documentation or sample code snippet to show how to do this?
Or, explicitly, checking against these possible values is my only option?
Does this help? http://www.boost.org/doc/html/program_options/howto.html#id1420416 In Christ, Steven Watanabe
participants (2)
-
Soumen
-
Steven Watanabe