Add Grouped behaviour.
[command.git] / src / main.cpp
index 42c44cb57118ee8b6e0bd2096c31fd4e9de5658d..5ad96a22520a2e9f5c1547e8e184d2f3f3a3e674 100644 (file)
@@ -4,6 +4,8 @@
 #include "option.h"
 #include "argument.h"
 #include "required.h"
+#include "multiValue.h"
+#include "grouped.h"
 #include "command.h"
 
 using namespace command;
@@ -23,12 +25,12 @@ void void_function(void) {
 int main(int argc, char *argv[]) {
     try {
         Command command(argc, argv, {
-//             new Argument<std::string>("File path", [](std::string value)->void { std::cout << "Hello from lambda " << value << std::endl; }),
-            new Required(new Argument<bool>("File path", argument_function)),
-            new Option<std::string>("f", "Optional file", option_function),
+            new Grouped({
+                new Required(new MultiValue("-", new Argument<bool>("Input values", argument_function))),
+                new MultiValue(",", new Option<std::string>("f", "Optional file", option_function))
+            }),
             new Option<void>("h", "Help", void_function)
         });
-
     }
     catch(const std::exception & e) {
         std::cout << e.what() << std::endl;