aboutsummaryrefslogtreecommitdiff
path: root/third-party/cxxopts/README.md
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2020-10-06 16:06:07 +0100
committerColm Donelan <colm.donelan@arm.com>2020-10-06 19:38:08 +0000
commit84dc8430432c0a65c2fdc8946e06d307d18df28d (patch)
treec82fd792db0d2549d4c602aff97571915216ccbb /third-party/cxxopts/README.md
parentb524ca0303ccaf452c3d59d66fa5cbb12975f4a8 (diff)
downloadarmnn-84dc8430432c0a65c2fdc8946e06d307d18df28d.tar.gz
IVGCVSW-4488 Update cxxopts to version 3.0
* Required to fix issue in TfLiteMobilenetQuantized-Armnn.cpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I3a465f62e3d656c9626113da6223e4fa26b535a6
Diffstat (limited to 'third-party/cxxopts/README.md')
-rw-r--r--third-party/cxxopts/README.md52
1 files changed, 52 insertions, 0 deletions
diff --git a/third-party/cxxopts/README.md b/third-party/cxxopts/README.md
index f157052bae..9517993d04 100644
--- a/third-party/cxxopts/README.md
+++ b/third-party/cxxopts/README.md
@@ -5,6 +5,25 @@
Note that `master` is generally a work in progress, and you probably want to use a
tagged release version.
+## Version 3 breaking changes
+
+If you have used version 2, there are a couple of breaking changes in (the as
+yet unreleased, current master) version 3 that you should be aware of. If you are new to
+`cxxopts` you can skip this section.
+
+The parser no longer modifies its arguments, so you can pass a const `argc` and
+`argv` and expect them not to be changed.
+
+The `ParseResult` object no longer depends on the parser. So it can be returned
+from a scope outside the parser and still work. Now that the inputs are not
+modified, `ParseResult` stores a list of the unmatched arguments. These are
+retrieved like follows:
+
+```cpp
+auto result = options.parse(argc, argv);
+result.unmatched(); // get the unmatched arguments
+```
+
# Quick start
This is a lightweight C++ option parser library, supporting the standard GNU
@@ -69,6 +88,23 @@ exception will be thrown.
Note that the result of `options.parse` should only be used as long as the
`options` object that created it is in scope.
+## Unrecognised arguments
+
+You can allow unrecognised arguments to be skipped. This applies to both
+positional arguments that are not parsed into another option, and `--`
+arguments that do not match an argument that you specify. This is done by
+calling:
+
+```cpp
+options.allow_unrecognised_options();
+```
+
+and in the result object they are retrieved with:
+
+```cpp
+result.unmatched()
+```
+
## Exceptions
Exceptional situations throw C++ exceptions. There are two types of
@@ -146,6 +182,22 @@ that can be parsed as a `std::vector<double>`:
--my_list=1,-2.1,3,4.5
~~~
+## Options specified multiple times
+
+The same option can be specified several times, with different arguments, which will all
+be recorded in order of appearance. An example:
+
+~~~
+--use train --use bus --use ferry
+~~~
+
+this is supported through the use of a vector of value for the option:
+
+~~~
+options.add_options()
+ ("use", "Usable means of transport", cxxopts::value<std::vector<std::string>>())
+~~~
+
## Custom help
The string after the program name on the first line of the help can be