chore: codacity (#621)

* docs: fix some Codacity recommendations

* chore: update copyright year

* style: more codacity fixes

* style: fix issues reported by Codacity
This commit is contained in:
Henry Schreiner
2021-07-16 17:41:46 -04:00
committed by GitHub
parent 9e247b1a0c
commit b4f6be31c1
79 changed files with 410 additions and 384 deletions

View File

@@ -1,8 +1,8 @@
# CLI11: An introduction
This gitbook is designed to provide an introduction to using the CLI11 library to write your own command line programs. The library is designed to be clean, intuitive, but powerful. There are no requirements beyond C++11 support (and even `<regex>` support not required). It works on Mac, Linux, and Windows, and has 100% test coverage on all three systems. You can simply drop in a single header file (`CLI11.hpp` available in [releases]) to use CLI11 in your own application. Other ways to integrate it into a build system are listed in the [README].
This gitbook is designed to provide an introduction to using the CLI11 library to write your own command line programs. The library is designed to be clean, intuitive, but powerful. There are no requirements beyond C++11 support (and even `<regex>` support not required). It works on Mac, Linux, and Windows, and has 100% test coverage on all three systems. You can simply drop in a single header file (`CLI11.hpp` available in [releases]) to use CLI11 in your own application. Other ways to integrate it into a build system are listed in the [README][].
The library was inspired the Python libraries [Plumbum] and [Click], and incorporates many of their user friendly features. The library is extensively documented, with a [friendly introduction][README], this tutorial book, and more technical [API docs].
The library was inspired the Python libraries [Plumbum][] and [Click][], and incorporates many of their user friendly features. The library is extensively documented, with a [friendly introduction][README], this tutorial book, and more technical [API docs][].
> Feel free to contribute to [this documentation here][CLI11Tutorial] if something can be improved!
@@ -49,9 +49,9 @@ You can use any valid type; the above example could have used a `boost::file_sys
You can use subcommands, as well. Subcommands support callback lambda functions when parsed, or they can be checked later. You can infinitely nest subcommands, and each is a full `App` instance, supporting everything listed above.
Reading/producing `.ini` files for configuration is also supported, as is using environment variables as input. The base `App` can be subclassed and customized for use in a toolkit (like [GooFit]). All the standard shell idioms, like `--`, work as well.
Reading/producing `.ini` files for configuration is also supported, as is using environment variables as input. The base `App` can be subclassed and customized for use in a toolkit (like [GooFit][]). All the standard shell idioms, like `--`, work as well.
CLI11 was developed at the [University of Cincinnati] in support of the [GooFit] library under [NSF Award 1414736][NSF 1414736]. It was featured in a [DIANA/HEP] meeting at CERN. Please give it a try! Feedback is always welcome.
CLI11 was developed at the [University of Cincinnati] in support of the [GooFit][] library under [NSF Award 1414736][NSF 1414736]. It was featured in a [DIANA/HEP] meeting at CERN. Please give it a try! Feedback is always welcome.
[GooFit]: https://github.com/GooFit/GooFit
[DIANA/HEP]: http://diana-hep.org

View File

@@ -176,6 +176,6 @@ For custom configuration files this behavior can be triggered by specifying the
The config file input works with any form of the option given: Long, short, positional, or the environment variable name. When generating a config file it will create a name in following priority.
1. First long name
1. Positional name
1. First short name
1. Environment name
2. Positional name
3. First short name
4. Environment name

View File

@@ -123,4 +123,4 @@ Flag plain: 1
```
[^1] It will not inherit this from the parent defaults, since this is often useful even if you don't want all options to allow multiple passed options.
[^1]: It will not inherit this from the parent defaults, since this is often useful even if you don't want all options to allow multiple passed options.

View File

@@ -7,7 +7,6 @@ C++ application, though the system git uses to extend the main command by callin
in separate executables is supported too; that's called "Prefix commands" and is included at the
end of this chapter.
## The parent App
We'll start by discussing the parent `App`. You've already used it quite a bit, to create
@@ -18,7 +17,6 @@ You can replace the default help print when a `ParseError` is thrown with `app.s
The default is `CLI:::FailureMessage::simple`, and you can easily define a new one. Just make a (lambda) function that takes an App pointer
and a reference to an error code (even if you don't use them), and returns a string.
## Adding a subcommand
Subcommands can be added just like an option: