From 4b6cae9b8f14fb51455cd717cfb80cdc4d72ee4f Mon Sep 17 00:00:00 2001 From: jarro2783 Date: Mon, 28 Sep 2015 12:51:30 +1000 Subject: [PATCH 1/4] add positional arguments to readme --- README | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README b/README index 94a1f11..5e8a855 100644 --- a/README +++ b/README @@ -44,6 +44,14 @@ it appeared, and to get its value. If "opt" doesn't exist, or isn't of the right type, then an exception will be thrown. +=== Positional Arguments === + +Positional arguments can be optionally parsed into one or more options. To set up positional arguments, call + + options.parse_positional({"first", "second", "last"}) + +where "last" should be the name of an option with a container type, and the others should have a single value. + == Linking == This is a header only library. From 7d49500f54b81b58357313515701c6454d9449bc Mon Sep 17 00:00:00 2001 From: jarro2783 Date: Mon, 28 Sep 2015 12:53:26 +1000 Subject: [PATCH 2/4] Rename README to README.md --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 4c3d1159cfca16e323635723d104da128b4522f1 Mon Sep 17 00:00:00 2001 From: jarro2783 Date: Mon, 28 Sep 2015 12:54:46 +1000 Subject: [PATCH 3/4] Change headings to markdown --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5e8a855..7183b18 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -== Quick start == +# Quick start This is a lightweight C++ option parser library, supporting the standard GNU style syntax for options. @@ -44,7 +44,7 @@ it appeared, and to get its value. If "opt" doesn't exist, or isn't of the right type, then an exception will be thrown. -=== Positional Arguments === +## Positional Arguments Positional arguments can be optionally parsed into one or more options. To set up positional arguments, call @@ -52,17 +52,17 @@ Positional arguments can be optionally parsed into one or more options. To set u where "last" should be the name of an option with a container type, and the others should have a single value. -== Linking == +# Linking This is a header only library. -== Requirements == +# Requirements The only build requirement is a C++ compiler that supports C++11 regular expressions. For example GCC >= 4.9 or clang with libc++. -== TODO list == +# TODO list * Allow unrecognised options. * Various help strings. From 8d0ff87fe7ae48f9de212016ace71d96dbde4f61 Mon Sep 17 00:00:00 2001 From: jarro2783 Date: Mon, 28 Sep 2015 12:56:03 +1000 Subject: [PATCH 4/4] Fix some more formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7183b18..904ef91 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Options can be given as: where c takes an argument, but a and b do not. -How to use: +## Basics #include @@ -36,7 +36,7 @@ To parse the command line do: options.parse(argc, argv); -To retrieve an option use options.count("option") to get the number of times +To retrieve an option use `options.count("option")` to get the number of times it appeared, and options["opt"].as()