From: Rafał Długołęcki Date: Sun, 26 Apr 2015 12:22:44 +0000 (+0200) Subject: Updated Examples in README. X-Git-Tag: v0.2~38 X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=f58dd574d6d7c44b91c31df2f6ebf32baf0a95fd;p=command.git Updated Examples in README. --- diff --git a/README b/README index add8614..0bb82e9 100644 --- a/README +++ b/README @@ -3,10 +3,16 @@ Command, a C++ library for handling command line arguments Designing to be used like follows: Example: + + void some_function(std::string str) { + std::cout << "Some function" << std::endl; + } + command::Command command(argc, argv, { command::Option("f", "File path", [](std::string value)->void { cout << "Sth: " << value << endl; }), command::Argument("File path", []()->void { cout << "Sth: " << value << endl; }), command::Option("help", "Help description", [](void)->void { cout << "Sth: " << value << endl; }), - command::Option("verbose", "Verbose option description", &myClass->verbose) + command::Option("verbose", "Verbose option description", &myClass->verbose), + command::Option("verbose", "Verbose option description", some_function) });