8 #include "multiValue.h"
12 using namespace command;
16 * @brief Simple example explaining how to bind functions to command-line parameters
19 void argument_function(bool a) {
20 std::cout << "Argument: " << a << std::endl;
23 void option_function(std::string a) {
24 std::cout << "Help function " << a << std::endl;
27 void void_function(void) {
28 std::cout << "Void function " << std::endl;
31 int main(int argc, char **argv)
34 Command command(argc, argv, {
35 // function with bool parameter
36 new Argument<bool>("Input values", argument_function),
38 // function with std::string parameter
39 new Option<std::string>("f", "Optional file", option_function),
41 // function without parameter
42 new Option<void>("h", "Help", void_function)
45 /* Code is initialized.
47 * You can run your main program e.g. here
50 catch(const std::exception & e) {
51 std::cout << e.what() << std::endl;