9 using namespace command;
11 void argument_function(bool a) {
12 std::cout << "Argument: " << a << std::endl;
15 void option_function(std::string a) {
16 std::cout << "Help function " << a << std::endl;
19 void void_function(void) {
20 std::cout << "Void function " << std::endl;
23 int main(int argc, char *argv[]) {
25 Command command(argc, argv, {
26 // new Argument<std::string>("File path", [](std::string value)->void { std::cout << "Hello from lambda " << value << std::endl; }),
27 new Required(new Argument<bool>("File path", argument_function)),
28 new Option<std::string>("f", "Optional file", option_function),
29 new Option<void>("h", "Help", void_function)
33 catch(const std::exception & e) {
34 std::cout << e.what() << std::endl;