diff --git a/README.md b/README.md index 2a96e559..22d15069 100644 --- a/README.md +++ b/README.md @@ -604,7 +604,7 @@ The subcommand method .add_option_group(name,description) ``` -Will create an option group, and return a pointer to it. An option group allows creation of a collection of options, similar to the groups function on options, but with additional controls and requirements. They allow specific sets of options to be composed and controlled as a collective. For an example see [range test](./tests/ranges.cpp). Option groups are a specialization of an App so all [functions](#subcommand-options) that work with an App or subcommand also work on option groups. Options can be created as part of an option group using the add functions just like a subcommand, or previously created options can be added through +Will create an option group, and return a pointer to it. An option group allows creation of a collection of options, similar to the groups function on options, but with additional controls and requirements. They allow specific sets of options to be composed and controlled as a collective. For an example see [range example](https://github.com/CLIUtils/CLI11/blob/master/examples/ranges.cpp). Option groups are a specialization of an App so all [functions](#subcommand-options) that work with an App or subcommand also work on option groups. Options can be created as part of an option group using the add functions just like a subcommand, or previously created options can be added through ```cpp ogroup->add_option(option_pointer); diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index c1e06b34..1e19607b 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -1292,7 +1292,7 @@ class App { } std::vector args; - args.reserve(static_cast(argc - 1)); + args.reserve(static_cast(argc) - 1); for(int i = argc - 1; i > 0; i--) args.emplace_back(argv[i]); parse(std::move(args)); @@ -2317,7 +2317,7 @@ class App { // LCOV_EXCL_START default: - HorribleError("unrecognized classifier (you should not see this!)"); + throw HorribleError("unrecognized classifier (you should not see this!)"); // LCOV_EXCL_END } return retval; diff --git a/include/CLI/Option.hpp b/include/CLI/Option.hpp index 3d90ab87..024e2fb7 100644 --- a/include/CLI/Option.hpp +++ b/include/CLI/Option.hpp @@ -527,7 +527,7 @@ class Option : public OptionBase