Add possibility to set Required Parameters.
[command.git] / src / main.cpp
index 5a42e860c14eaad667c3ca656e93be3b23ca85e1..5cf4e83d018373e5e665bafaee685ee2989e7bff 100644 (file)
@@ -3,8 +3,11 @@
 
 #include "option.h"
 #include "argument.h"
+#include "required.h"
 #include "command.h"
 
+using namespace command;
+
 void argument_function(bool a) {
     std::cout << "Argument: " << a << std::endl;
 }
@@ -18,11 +21,11 @@ void void_function(void) {
 }
 
 int main(int argc, char *argv[]) {
-    command::Command command(argc, argv, {
-//         new command::Argument<std::string>("File path", [](std::string value)->void { std::cout << "Hello from lambda " << value << std::endl; }),
-        new command::Argument<bool>("File path", argument_function),
-        new command::Option<std::string>("f", "Optional file", option_function),
-        new command::Option<void>("h", "Help", void_function)
+    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 Option<void>("h", "Help", void_function)
     });
 
     return 0;