jarro2783 / cxxopts

Lightweight C++ command line option parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How about to limit the values of option with user specified value set?

mrbeardad opened this issue · comments

options.add_options()(
    "opt", "desc",
    cxxopts::value<std::string>()->limit_value(
        std::unordered_set<std::string>{"only", "these", "values", "are", "allowed"}));

I am working on adding a way to do arbitrary option validation like this.

I'm also interested in such a feature. Are there any news on this?

I'll see if I can get to this soon.