1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

Minor typo fixes in README

[skip ci]
This commit is contained in:
Henry Fredrick Schreiner 2017-11-22 14:58:10 -05:00
parent 851f8dc83d
commit 87425617cd
2 changed files with 6 additions and 7 deletions

View File

@ -10,7 +10,7 @@
# CLI11: Command line parser for C++11
CLI11 provides all the features you expect in a powerful command line parser, with a beautiful, minimal syntax and no dependencies beyond C++11. It is header only, and comes in a single file form for easy inclusion in projects. It is easy to use for small projects, but powerful enough for complex command line projects, and can be customized for frameworks.
It is tested on [Travis] and [AppVeyor], and is being included in the [GooFit GPU fitting framework][GooFit]. It was inspired by [`plumbum.cli`][Plumbum] for Python. CLI11 has a user friendly introduction in this README, a more indepth tutorial [GitBook], as well as [API documentation][api-docs] generated by Travis.
It is tested on [Travis] and [AppVeyor], and is being included in the [GooFit GPU fitting framework][GooFit]. It was inspired by [`plumbum.cli`][Plumbum] for Python. CLI11 has a user friendly introduction in this README, a more in-depth tutorial [GitBook], as well as [API documentation][api-docs] generated by Travis.
See the [changelog](./CHANGELOG.md) or [GitHub Releases] for details for current and past releases. The version 1.0 announcement post can be found [here](http://iscinumpy.blogspot.com/2017/06/announcing-cli11-version-10.html).
### Why write another CLI parser?
@ -30,7 +30,7 @@ An acceptable CLI parser library should be all of the following:
* Ability to add a configuration file (`ini` format).
* Produce real values that can be used directly in code, not something you have pay compute time to look up, for HPC applications.
* Work with standard types, simple custom types, and extendible to exotic types.
* Permissively licenced.
* Permissively licensed.
The major CLI parsers for C++ include (with my biased opinions):
@ -209,7 +209,7 @@ There are several options that are supported on the main app and subcommands. Th
* `.ignore_case()`: Ignore the case of this subcommand. Inherited by added subcommands, so is usually used on the main `App`.
* `.fallthrough()`: Allow extra unmatched options and positionals to "fall through" and be matched on a parent command. Subcommands always are allowed to fall through.
* `.require_subcommand()`: Require 1 or more subcommands.
* `.require_subcommand(N)`: Require `N` subcommands if `N`>0, or up to `N` if `N`<0. N=0 resets to the default 0 or more.
* `.require_subcommand(N)`: Require `N` subcommands if `N>0`, or up to `N` if `N<0`. `N=0` resets to the default 0 or more.
* `.require_subcommand(min, max)`: Explicilty set min and max allowed subcommands. Setting `max` to 0 is unlimited.
* `.add_subcommand(name, description="")` Add a subcommand, returns a pointer to the internally stored subcommand.
* `.got_subcommand(App_or_name)`: Check to see if a subcommand was received on the command line
@ -219,7 +219,7 @@ There are several options that are supported on the main app and subcommands. Th
* `.allow_extras()`: Do not throw an error if extra arguments are left over
* `.prefix_command()`: Like `allow_extras`, but stop immediately on the first unrecognised item. It is ideal for allowing your app or subcommand to be a "prefix" to calling another app.
* `.set_footer(message)`: Set text to appear at the bottom of the help string.
* `.set_failure_message(func)`: Set the failure message function. Two provided: `CLI::FailureMessage::help` and CLI::FailureMessage::simple` (the default).
* `.set_failure_message(func)`: Set the failure message function. Two provided: `CLI::FailureMessage::help` and `CLI::FailureMessage::simple` (the default).
* `.group(name)`: Set a group name, defaults to `"Subcommands"`. Setting `""` will be hide the subcommand.
> Note: if you have a fixed number of required positional options, that will match before subcommand names.

View File

@ -356,16 +356,15 @@ TEST(THelp, CustomHelp) {
TEST(THelp, NiceName) {
CLI::App app;
int x;
auto long_name = app.add_option("-s,--long,-q,--other,that", x);
auto short_name = app.add_option("more,-x,-y", x);
auto positional = app.add_option("posit", x);
EXPECT_EQ(long_name->single_name(), "--long");
EXPECT_EQ(short_name->single_name(), "-x");
EXPECT_EQ(positional->single_name(), "posit");
}
TEST(Exit, ErrorWithHelp) {