Added mechanism to understand passed Option value.
[command.git] / src / main.cpp
1 #include <iostream>
2 #include <string>
3
4 #include "option.h"
5 #include "argument.h"
6 #include "command.h"
7
8 void some_function(bool a) {
9     std::cout << "Some function " << a << std::endl;
10 }
11
12 void help_function(std::string a) {
13     std::cout << "Some function " << a << std::endl;
14 }
15
16 int main(int argc, char *argv[]) {
17     command::Command command(argc, argv, {
18 //         new command::Argument<std::string>("File path", [](std::string value)->void { std::cout << "Hello from lambda " << value << std::endl; }),
19         new command::Argument<bool>("File path", some_function),
20         new command::Option<std::string>("h", "Help", help_function)
21     });
22
23     return 0;
24 }