Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jarro2783/cxxopts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEyal Rozenberg <eyalroz@technion.ac.il>2020-07-23 09:36:54 +0300
committerGitHub <noreply@github.com>2020-07-23 09:36:54 +0300
commit1b660d56801283905b0f0fdd43e7e7ba3c5c396e (patch)
tree6cd8a8d4d2413c08dfb9ade74b359711d99a3dd1
parent9a454c8e4e2b1356f356627bad6e3b932efd23c3 (diff)
Regards #244: Explain how vectors of values allow repeated use of the same option on the command-line. (#247)
-rw-r--r--README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index f157052..88b92d4 100644
--- a/README.md
+++ b/README.md
@@ -146,6 +146,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