Saving designed syntax
authorRafał Długołęcki <rafal@dlugolecki.net.pl>
Tue, 21 Apr 2015 22:16:50 +0000 (00:16 +0200)
committerRafał Długołęcki <rafal@dlugolecki.net.pl>
Tue, 21 Apr 2015 22:16:50 +0000 (00:16 +0200)
README
src/main.cpp

diff --git a/README b/README
index ec423e579015ece3e49a4a47ea6729dec4b112a9..add86148f874625eacb9a9b69dbe4517edf49c95 100644 (file)
--- a/README
+++ b/README
@@ -1 +1,12 @@
 Command, a C++ library for handling command line arguments
+
+Designing to be used like follows:
+
+Example:
+    command::Command command(argc, argv, {
+        command::Option<std::string>("f", "File path", [](std::string value)->void { cout << "Sth: " << value << endl; }),
+        command::Argument<std::string>("File path", []()->void { cout << "Sth: " << value << endl; }),
+        command::Option<void>("help", "Help description", [](void)->void { cout << "Sth: " << value << endl; }),
+        command::Option<void>("verbose", "Verbose option description", &myClass->verbose)
+    });
+
index 379d14a6e3004c3b1f4a16436994b2f98f01f881..37ca36f9d6cabd4ceb67bf239b8a6a9f3c0149d8 100644 (file)
@@ -1,4 +1,11 @@
 
 int main() {
+    command::Command command(argc, argv, {
+        command::Option<std::string>("f", "File path", [](std::string value)->void { cout << "Sth: " << value << endl; }),
+        command::Argument<std::string>("File path", []()->void { cout << "Sth: " << value << endl; }),
+        command::Option<void>("help", "Help description", [](void)->void { cout << "Sth: " << value << endl; }),
+        command::Option<void>("verbose", "Verbose option description", &myClass->verbose)
+    });
+
     return 0;
 }
\ No newline at end of file