X-Git-Url: https://git.dlugolecki.net.pl/?p=command.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=5a42e860c14eaad667c3ca656e93be3b23ca85e1;hp=017434559a71c9eca8c6e30f223d481c5d826f91;hb=c85d60a873e21052a470c172df4ba56a1c0d59c6;hpb=2900a7396aa582dcf622b968c286059b28d9c0a8 diff --git a/src/main.cpp b/src/main.cpp index 0174345..5a42e86 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,19 +5,24 @@ #include "argument.h" #include "command.h" -void some_function(bool a) { - std::cout << "Some function " << a << std::endl; +void argument_function(bool a) { + std::cout << "Argument: " << a << std::endl; } -void help_function(std::string a) { - std::cout << "Some function " << a << std::endl; +void option_function(std::string a) { + std::cout << "Help function " << a << std::endl; +} + +void void_function(void) { + std::cout << "Void function " << std::endl; } int main(int argc, char *argv[]) { command::Command command(argc, argv, { // new command::Argument("File path", [](std::string value)->void { std::cout << "Hello from lambda " << value << std::endl; }), - new command::Argument("File path", some_function), - new command::Option("h", "Help", help_function) + new command::Argument("File path", argument_function), + new command::Option("f", "Optional file", option_function), + new command::Option("h", "Help", void_function) }); return 0;