Add possibility to set Required Parameters.
[command.git] / src / main.cpp
1 #include <iostream>
2 #include <string>
3
4 #include "option.h"
5 #include "argument.h"
6 #include "required.h"
7 #include "command.h"
8
9 using namespace command;
10
11 void argument_function(bool a) {
12     std::cout << "Argument: " << a << std::endl;
13 }
14
15 void option_function(std::string a) {
16     std::cout << "Help function " << a << std::endl;
17 }
18
19 void void_function(void) {
20     std::cout << "Void function " << std::endl;
21 }
22
23 int main(int argc, char *argv[]) {
24     Command command(argc, argv, {
25 //         new Argument<std::string>("File path", [](std::string value)->void { std::cout << "Hello from lambda " << value << std::endl; }),
26         new Required(new Argument<bool>("File path", argument_function)),
27         new Option<std::string>("f", "Optional file", option_function),
28         new Option<void>("h", "Help", void_function)
29     });
30
31     return 0;
32 }