Skip to content

Instantly share code, notes, and snippets.

@klmr
Created May 8, 2014 13:49
Show Gist options
  • Save klmr/10ff02ef491e05092b4a to your computer and use it in GitHub Desktop.
Save klmr/10ff02ef491e05092b4a to your computer and use it in GitHub Desktop.
auto&& hello = command<int, std::string>{{
option{"--count", 1, "number of greetings"},
option{"--name", "", "the person to greet", flags::required}},
[](int count, std::string name) {
for (auto i : range(0, count))
std::cout << "Hello " << name << '\n';
}};
int main(int argc, char* argv[]) {
return hello(argc, argv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment