X-Git-Url: https://git.dlugolecki.net.pl/?p=command.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=5ad96a22520a2e9f5c1547e8e184d2f3f3a3e674;hp=06fbf1e14bd7befddfa64ccff38b62e5402edc19;hb=f2d683504e2dc76868ec84d7c1fd858edc0df5a4;hpb=f4f7e7543fb56070a408da837cf4e42333504348 diff --git a/src/main.cpp b/src/main.cpp index 06fbf1e..5ad96a2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ #include "argument.h" #include "required.h" #include "multiValue.h" +#include "grouped.h" #include "command.h" using namespace command; @@ -24,12 +25,12 @@ void void_function(void) { int main(int argc, char *argv[]) { try { Command command(argc, argv, { -// new Argument("File path", [](std::string value)->void { std::cout << "Hello from lambda " << value << std::endl; }), - new Required(new MultiValue("-", new Argument("Input values", argument_function))), - new MultiValue(",", new Option("f", "Optional file", option_function)), + new Grouped({ + new Required(new MultiValue("-", new Argument("Input values", argument_function))), + new MultiValue(",", new Option("f", "Optional file", option_function)) + }), new Option("h", "Help", void_function) }); - } catch(const std::exception & e) { std::cout << e.what() << std::endl;