From 84dc8430432c0a65c2fdc8946e06d307d18df28d Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Tue, 6 Oct 2020 16:06:07 +0100 Subject: IVGCVSW-4488 Update cxxopts to version 3.0 * Required to fix issue in TfLiteMobilenetQuantized-Armnn.cpp Signed-off-by: Matthew Sloyan Change-Id: I3a465f62e3d656c9626113da6223e4fa26b535a6 --- third-party/cxxopts/README.md | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'third-party/cxxopts/README.md') 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`: --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>()) +~~~ + ## Custom help The string after the program name on the first line of the help can be -- cgit v1.2.1