README.md : Corrected syntax error in example

This commit is contained in:
Hish15 2023-09-28 11:25:06 +02:00 committed by GitHub
parent c8c932f891
commit 000bfbfeae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,12 +57,11 @@ cxxopts::Options options("MyProgram", "One line description of MyProgram");
Then use `add_options`. Then use `add_options`.
```cpp ```cpp
options.add_options() options.add_options(
("d,debug", "Enable debugging") // a bool parameter ("d,debug", "Enable debugging") // a bool parameter
("i,integer", "Int param", cxxopts::value<int>()) ("i,integer", "Int param", cxxopts::value<int>())
("f,file", "File name", cxxopts::value<std::string>()) ("f,file", "File name", cxxopts::value<std::string>())
("v,verbose", "Verbose output", cxxopts::value<bool>()->default_value("false")) ("v,verbose", "Verbose output", cxxopts::value<bool>()->default_value("false"));
;
``` ```
Options are declared with a long and an optional short option. A description Options are declared with a long and an optional short option. A description