We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To restrict the set of values for an argument, a custom action is needed as the example in README.md:
program.add_argument("input") .default_value(std::string{"baz"}) .action([](const std::string& value) { static const std::vector<std::string> choices = { "foo", "bar", "baz" }; if (std::find(choices.begin(), choices.end(), value) != choices.end()) { return value; } return std::string{ "baz" }; });
Built-int choices arguments support will be more convenient, such like:
program.add_argument("input") .default_value(std::string{"baz"}) .choices("foo", "bar", "baz");
Thanks!
The text was updated successfully, but these errors were encountered:
Is this going to be implemented any time soon ? Can I be of any help ?
Sorry, something went wrong.
#277 Added in-built support for string_type choices
9bb553b
b10afeb
Thanks ! :)
p-ranav#277 Added in-built support for string_type choices
bcf0a8f
No branches or pull requests
To restrict the set of values for an argument, a custom action is needed as the example in README.md:
Built-int choices arguments support will be more convenient, such like:
Thanks!
The text was updated successfully, but these errors were encountered: