8 #include "multiValue.h"
12 using namespace command;
14 void argument_function(bool a) {
15 std::cout << "Argument: " << a << std::endl;
18 void option_function(std::string a) {
19 std::cout << "Help function " << a << std::endl;
22 void void_function(void) {
23 std::cout << "Void function " << std::endl;
28 void _argument(bool a) {
31 void _option(std::string a) {
39 int main(int argc, char *argv[]) {
43 Command command(argc, argv, {
47 new Argument<bool>("Input values", std::bind(&ExampleClass::_argument, &c, std::placeholders::_1))
51 new Option<std::string>("f", "Optional file", std::bind(&ExampleClass::_option, &c, std::placeholders::_1))
54 new Option<void>("h", "Help", std::bind(&ExampleClass::_void, &c)),
56 // just a pure method calling
57 new Option<void>("v", "version", void_function)
60 /* ExampleClass is initialized.
61 * You can run your main program now
64 catch(const std::exception & e) {
65 std::cout << e.what() << std::endl;