From 98d200bd8b64a6a5d1aa81b7bc9175a951c591c8 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 16 Oct 2021 23:09:04 -0400 Subject: [PATCH] chore: move to main --- .appveyor.yml | 2 +- .github/workflows/build.yml | 1 - .github/workflows/tests.yml | 1 - .travis.yml | 4 +- CHANGELOG.md | 6 ++- README.md | 56 ++++++++++++++-------------- azure-pipelines.yml | 4 +- book/README.md | 4 +- book/chapters/an-advanced-example.md | 2 +- book/chapters/config.md | 2 +- book/chapters/flags.md | 2 +- docs/Doxyfile | 2 +- include/CLI/App.hpp | 8 ++-- include/CLI/TypeTools.hpp | 2 +- 14 files changed, 48 insertions(+), 48 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 18915a17..db1d6e82 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,7 @@ version: 2.1.1.{build} branches: only: - - master + - main - v1 install: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98ca2b86..a6f25040 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,6 @@ name: Build on: push: branches: - - master - main - v* tags: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 26374e46..a48b4e36 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,6 @@ name: Tests on: push: branches: - - master - main - v* pull_request: diff --git a/.travis.yml b/.travis.yml index d352aed9..2f99fcd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ dist: trusty # Include tags starting with v and a digit branches: only: - - master + - main - /^v\d/ cache: @@ -104,7 +104,7 @@ deploy: keep_history: false local_dir: ${TRAVIS_BUILD_DIR}/html on: - branch: master + branch: main condition: "$DEPLOY_MAT = yes" notifications: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0222a9ff..d5f7cff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## WIP +* Use `main` for the main branch of the repository [#657][] * Bugfix(cmake): Enforce at least C++11 when using CMake target [#656][] * Build: Don't run doxygen and CTest includes if a submodule [#656][] * Build: Avoid a warning on CMake 3.22 [#656][] @@ -9,6 +10,7 @@ [#653]: https://github.com/CLIUtils/CLI11/pull/653 [#656]: https://github.com/CLIUtils/CLI11/pull/656 +[#657]: https://github.com/CLIUtils/CLI11/pull/657 ## Version 2.1: Names and callbacks @@ -624,7 +626,7 @@ This release focused on cleaning up the most exotic compiler warnings, fixing a ## Version 0.8: CLIUtils -This release moved the repository to the CLIUtils master organization. +This release moved the repository to the CLIUtils main organization. * Moved to CLIUtils on GitHub * Fixed docs build and a few links @@ -659,7 +661,7 @@ Lots of cleanup and docs additions made it into this release. Parsing is simpler * `->ignore_case()` added to subcommands, options, and `add_set_ignore_case`. Subcommands inherit setting from parent App on creation. * Subcommands now can be "chained", that is, left over arguments can now include subcommands that then get parsed. Subcommands are now a list (`get_subcommands`). Added `got_subcommand(App_or_name)` to check for subcommands. * Added `.allow_extras()` to disable error on failure. Parse returns a vector of leftover options. Renamed error to `ExtrasError`, and now triggers on extra options too. -* Added `require_subcommand` to `App`, to simplify forcing subcommands. Do **not** do `add_subcommand()->require_subcommand`, since that is the subcommand, not the master `App`. +* Added `require_subcommand` to `App`, to simplify forcing subcommands. Do **not** do `add_subcommand()->require_subcommand`, since that is the subcommand, not the main `App`. * Added printout of ini file text given parsed options, skips flags. * Support for quotes and spaces in ini files * Fixes to allow support for Windows (added Appveyor) (Uses `-`, not `/` syntax) diff --git a/README.md b/README.md index d63bfeb5..a2fcbd0e 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ CLI11 is a command line parser for C++11 and beyond that provides a rich feature * [Contribute](#contribute) * [License](#license) -Features that were added in the last released major version are marked with "🆕". Features only available in master are marked with "🚧". +Features that were added in the last released major version are marked with "🆕". Features only available in main are marked with "🚧". ## Background @@ -604,7 +604,7 @@ There are several options that are supported on the main app and subcommands and * `.got_subcommand(App_or_name)`: Check to see if a subcommand was received on the command line. * `.get_subcommands(filter)`: The list of subcommands that match a particular filter function. * `.add_option_group(name="", description="")`: Add an [option group](#option-groups) to an App, an option group is specialized subcommand intended for containing groups of options or other groups for controlling how options interact. -* `.get_parent()`: Get the parent App or `nullptr` if called on master App. +* `.get_parent()`: Get the parent App or `nullptr` if called on main App. * `.get_option(name)`: Get an option pointer by option name will throw if the specified option is not available, nameless subcommands are also searched * `.get_option_no_throw(name)`: Get an option pointer by option name. This function will return a `nullptr` instead of throwing if the option is not available. * `.get_options(filter)`: Get the list of all defined option pointers (useful for processing the app for custom output formats). @@ -616,7 +616,7 @@ There are several options that are supported on the main app and subcommands and * `.parsed()`: True if this subcommand was given on the command line. * `.count()`: Returns the number of times the subcommand was called. * `.count(option_name)`: Returns the number of times a particular option was called. -* `.count_all()`: Returns the total number of arguments a particular subcommand processed, on the master App it returns the total number of processed commands. +* `.count_all()`: Returns the total number of arguments a particular subcommand processed, on the main App it returns the total number of processed commands. * `.name(name)`: Add or change the name. * `.callback(void() function)`: Set the callback for an app. Either sets the `pre_parse_callback` or the `final_callback` depending on the value of `immediate_callback`. See [Subcommand callbacks](#callbacks) for some additional details. * `.parse_complete_callback(void() function)`: Set the callback that runs at the completion of parsing. For subcommands this is executed at the completion of the single subcommand and can be executed multiple times. See [Subcommand callbacks](#callbacks) for some additional details. @@ -685,7 +685,7 @@ The subcommand method .add_option_group(name,description) ``` -Will create an option group, and return a pointer to it. The argument for `description` is optional and can be omitted. 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. The name given in an option group must not contain newlines or null characters.🆕 +Will create an option group, and return a pointer to it. The argument for `description` is optional and can be omitted. 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/main/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. The name given in an option group must not contain newlines or null characters.🆕 ```cpp ogroup->add_option(option_pointer); @@ -904,28 +904,28 @@ The API is [documented here][api-docs]. Also see the [CLI11 tutorial GitBook][gi Several short examples of different features are included in the repository. A brief description of each is included here -* [callback_passthrough](https://github.com/CLIUtils/CLI11/blob/master/examples/callback_passthrough.cpp): Example of directly passing remaining arguments through to a callback function which generates a CLI11 application based on existing arguments. -* [custom_parse](https://github.com/CLIUtils/CLI11/blob/master/examples/custom_parse.cpp): Based on [Issue #566](https://github.com/CLIUtils/CLI11/issues/566), example of custom parser -* [digit_args](https://github.com/CLIUtils/CLI11/blob/master/examples/digit_args.cpp): Based on [Issue #123](https://github.com/CLIUtils/CLI11/issues/123), uses digit flags to pass a value -* [enum](https://github.com/CLIUtils/CLI11/blob/master/examples/enum.cpp): Using enumerations in an option, and the use of [CheckedTransformer](#transforming-validators) -* [enum_ostream](https://github.com/CLIUtils/CLI11/blob/master/examples/enum_ostream.cpp): In addition to the contents of example enum.cpp, this example shows how a custom ostream operator overrides CLI11's enum streaming. -* [formatter](https://github.com/CLIUtils/CLI11/blob/master/examples/formatter.cpp): Illustrating usage of a custom formatter -* [groups](https://github.com/CLIUtils/CLI11/blob/master/examples/groups.cpp): Example using groups of options for help grouping and a the timer helper class -* [inter_argument_order](https://github.com/CLIUtils/CLI11/blob/master/examples/inter_argument_order.cpp): An app to practice mixing unlimited arguments, but still recover the original order. -* [json](https://github.com/CLIUtils/CLI11/blob/master/examples/json.cpp): Using JSON as a config file parser -* [modhelp](https://github.com/CLIUtils/CLI11/blob/master/examples/modhelp.cpp): How to modify the help flag to do something other than default -* [nested](https://github.com/CLIUtils/CLI11/blob/master/examples/nested.cpp): Nested subcommands -* [option_groups](https://github.com/CLIUtils/CLI11/blob/master/examples/option_groups.cpp): Illustrating the use of option groups and a required number of options. Based on [Issue #88](https://github.com/CLIUtils/CLI11/issues/88) to set interacting groups of options -* [positional_arity](https://github.com/CLIUtils/CLI11/blob/master/examples/positional_arity.cpp): Illustrating use of `preparse_callback` to handle situations where the number of arguments can determine which should get parsed, Based on [Issue #166](https://github.com/CLIUtils/CLI11/issues/166) -* [positional_validation](https://github.com/CLIUtils/CLI11/blob/master/examples/positional_validation.cpp): Example of how positional arguments are validated using the `validate_positional` flag, also based on [Issue #166](https://github.com/CLIUtils/CLI11/issues/166) -* [prefix_command](https://github.com/CLIUtils/CLI11/blob/master/examples/prefix_command.cpp): Illustrating use of the `prefix_command` flag. -* [ranges](https://github.com/CLIUtils/CLI11/blob/master/examples/ranges.cpp): App to demonstrate exclusionary option groups based on [Issue #88](https://github.com/CLIUtils/CLI11/issues/88) -* [shapes](https://github.com/CLIUtils/CLI11/blob/master/examples/shapes.cpp): Illustrating how to set up repeated subcommands Based on [gitter discussion](https://gitter.im/CLI11gitter/Lobby?at=5c7af6b965ffa019ea788cd5) -* [simple](https://github.com/CLIUtils/CLI11/blob/master/examples/simple.cpp): A simple example of how to set up a CLI11 Application with different flags and options -* [subcom_help](https://github.com/CLIUtils/CLI11/blob/master/examples/subcom_help.cpp): Configuring help for subcommands -* [subcom_partitioned](https://github.com/CLIUtils/CLI11/blob/master/examples/subcom_partitioned.cpp): Example with a timer and subcommands generated separately and added to the main app later. -* [subcommands](https://github.com/CLIUtils/CLI11/blob/master/examples/subcommands.cpp): Short example of subcommands -* [validators](https://github.com/CLIUtils/CLI11/blob/master/examples/validators.cpp): Example illustrating use of validators +* [callback_passthrough](https://github.com/CLIUtils/CLI11/blob/main/examples/callback_passthrough.cpp): Example of directly passing remaining arguments through to a callback function which generates a CLI11 application based on existing arguments. +* [custom_parse](https://github.com/CLIUtils/CLI11/blob/main/examples/custom_parse.cpp): Based on [Issue #566](https://github.com/CLIUtils/CLI11/issues/566), example of custom parser +* [digit_args](https://github.com/CLIUtils/CLI11/blob/main/examples/digit_args.cpp): Based on [Issue #123](https://github.com/CLIUtils/CLI11/issues/123), uses digit flags to pass a value +* [enum](https://github.com/CLIUtils/CLI11/blob/main/examples/enum.cpp): Using enumerations in an option, and the use of [CheckedTransformer](#transforming-validators) +* [enum_ostream](https://github.com/CLIUtils/CLI11/blob/main/examples/enum_ostream.cpp): In addition to the contents of example enum.cpp, this example shows how a custom ostream operator overrides CLI11's enum streaming. +* [formatter](https://github.com/CLIUtils/CLI11/blob/main/examples/formatter.cpp): Illustrating usage of a custom formatter +* [groups](https://github.com/CLIUtils/CLI11/blob/main/examples/groups.cpp): Example using groups of options for help grouping and a the timer helper class +* [inter_argument_order](https://github.com/CLIUtils/CLI11/blob/main/examples/inter_argument_order.cpp): An app to practice mixing unlimited arguments, but still recover the original order. +* [json](https://github.com/CLIUtils/CLI11/blob/main/examples/json.cpp): Using JSON as a config file parser +* [modhelp](https://github.com/CLIUtils/CLI11/blob/main/examples/modhelp.cpp): How to modify the help flag to do something other than default +* [nested](https://github.com/CLIUtils/CLI11/blob/main/examples/nested.cpp): Nested subcommands +* [option_groups](https://github.com/CLIUtils/CLI11/blob/main/examples/option_groups.cpp): Illustrating the use of option groups and a required number of options. Based on [Issue #88](https://github.com/CLIUtils/CLI11/issues/88) to set interacting groups of options +* [positional_arity](https://github.com/CLIUtils/CLI11/blob/main/examples/positional_arity.cpp): Illustrating use of `preparse_callback` to handle situations where the number of arguments can determine which should get parsed, Based on [Issue #166](https://github.com/CLIUtils/CLI11/issues/166) +* [positional_validation](https://github.com/CLIUtils/CLI11/blob/main/examples/positional_validation.cpp): Example of how positional arguments are validated using the `validate_positional` flag, also based on [Issue #166](https://github.com/CLIUtils/CLI11/issues/166) +* [prefix_command](https://github.com/CLIUtils/CLI11/blob/main/examples/prefix_command.cpp): Illustrating use of the `prefix_command` flag. +* [ranges](https://github.com/CLIUtils/CLI11/blob/main/examples/ranges.cpp): App to demonstrate exclusionary option groups based on [Issue #88](https://github.com/CLIUtils/CLI11/issues/88) +* [shapes](https://github.com/CLIUtils/CLI11/blob/main/examples/shapes.cpp): Illustrating how to set up repeated subcommands Based on [gitter discussion](https://gitter.im/CLI11gitter/Lobby?at=5c7af6b965ffa019ea788cd5) +* [simple](https://github.com/CLIUtils/CLI11/blob/main/examples/simple.cpp): A simple example of how to set up a CLI11 Application with different flags and options +* [subcom_help](https://github.com/CLIUtils/CLI11/blob/main/examples/subcom_help.cpp): Configuring help for subcommands +* [subcom_partitioned](https://github.com/CLIUtils/CLI11/blob/main/examples/subcom_partitioned.cpp): Example with a timer and subcommands generated separately and added to the main app later. +* [subcommands](https://github.com/CLIUtils/CLI11/blob/main/examples/subcommands.cpp): Short example of subcommands +* [validators](https://github.com/CLIUtils/CLI11/blob/main/examples/validators.cpp): Example illustrating use of validators ## Contribute @@ -1020,13 +1020,13 @@ CLI11 was developed at the [University of Cincinnati][] to support of the [GooFi [doi-badge]: https://zenodo.org/badge/80064252.svg [doi-link]: https://zenodo.org/badge/latestdoi/80064252 -[azure-badge]: https://dev.azure.com/CLIUtils/CLI11/_apis/build/status/CLIUtils.CLI11?branchName=master +[azure-badge]: https://dev.azure.com/CLIUtils/CLI11/_apis/build/status/CLIUtils.CLI11?branchName=main [azure]: https://dev.azure.com/CLIUtils/CLI11 [actions-link]: https://github.com/CLIUtils/CLI11/actions [actions-badge]: https://github.com/CLIUtils/CLI11/actions/workflows/tests.yml/badge.svg [repology-badge]: https://repology.org/badge/latest-versions/cli11.svg [repology]: https://repology.org/project/cli11/versions -[codecov-badge]: https://codecov.io/gh/CLIUtils/CLI11/branch/master/graph/badge.svg +[codecov-badge]: https://codecov.io/gh/CLIUtils/CLI11/branch/main/graph/badge.svg [codecov]: https://codecov.io/gh/CLIUtils/CLI11 [gitter-badge]: https://badges.gitter.im/CLI11gitter/Lobby.svg [gitter]: https://gitter.im/CLI11gitter/Lobby diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c72c748e..750ac31d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,11 +4,11 @@ # https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc trigger: -- master +- main - 'v*' pr: -- master +- main - 'v*' variables: diff --git a/book/README.md b/book/README.md index 593adbc9..917e753f 100644 --- a/book/README.md +++ b/book/README.md @@ -28,7 +28,7 @@ Like any good command line application, help is provided. This program can be im [include](code/intro.cpp) -[Source code](https://github.com/CLIUtils/CLI11/blob/master/book/code/intro.cpp) +[Source code](https://github.com/CLIUtils/CLI11/blob/main/book/code/intro.cpp) Unlike some other libraries, this is enough to exit correctly and cleanly if help is requested or if incorrect arguments are passed. You can try this example out for yourself. To compile with GCC: @@ -58,7 +58,7 @@ CLI11 was developed at the [University of Cincinnati][] in support of the [GooFi [cli11tutorial]: https://cliutils.github.io/CLI11/book [releases]: https://github.com/CLIUtils/CLI11/releases [api docs]: https://cliutils.github.io/CLI11 -[readme]: https://github.com/CLIUtils/CLI11/blob/master/README.md +[readme]: https://github.com/CLIUtils/CLI11/blob/main/README.md [nsf 1414736]: https://nsf.gov/awardsearch/showAward?AWD_ID=1414736 [university of cincinnati]: https://www.uc.edu [plumbum]: https://plumbum.readthedocs.io/en/latest/ diff --git a/book/chapters/an-advanced-example.md b/book/chapters/an-advanced-example.md index 82fe7b71..84e838eb 100644 --- a/book/chapters/an-advanced-example.md +++ b/book/chapters/an-advanced-example.md @@ -16,7 +16,7 @@ All that's need now is the parse call. We'll print a little message after the co [include:"Parse"](../code/geet.cpp) -[Source code](https://github.com/CLIUtils/CLI11/tree/master/book/code/geet.cpp) +[Source code](https://github.com/CLIUtils/CLI11/tree/main/book/code/geet.cpp) If you compile and run: diff --git a/book/chapters/config.md b/book/chapters/config.md index df004ce7..79295bdb 100644 --- a/book/chapters/config.md +++ b/book/chapters/config.md @@ -195,7 +195,7 @@ Finally, set your new class as new config formatter: app.config_formatter(std::make_shared()); ``` -See [`examples/json.cpp`](https://github.com/CLIUtils/CLI11/blob/master/examples/json.cpp) for a complete JSON config example. +See [`examples/json.cpp`](https://github.com/CLIUtils/CLI11/blob/main/examples/json.cpp) for a complete JSON config example. ### Trivial JSON configuration example diff --git a/book/chapters/flags.md b/book/chapters/flags.md index aa920fe8..4e269acd 100644 --- a/book/chapters/flags.md +++ b/book/chapters/flags.md @@ -97,7 +97,7 @@ The values would be used like this: [include:"usage"](../code/flags.cpp) -[Source code](https://github.com/CLIUtils/CLI11/tree/master/book/code/flags.cpp) +[Source code](https://github.com/CLIUtils/CLI11/tree/main/book/code/flags.cpp) If you compile and run: diff --git a/docs/Doxyfile b/docs/Doxyfile index d08a2902..c86b0ba7 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -1325,7 +1325,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 9d3b3c3e..803f0f7f 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -1739,10 +1739,10 @@ class App { /// Get a pointer to the version option. (const) const Option *get_version_ptr() const { return version_ptr_; } - /// Get the parent of this subcommand (or nullptr if master app) + /// Get the parent of this subcommand (or nullptr if main app) App *get_parent() { return parent_; } - /// Get the parent of this subcommand (or nullptr if master app) (const version) + /// Get the parent of this subcommand (or nullptr if main app) (const version) const App *get_parent() const { return parent_; } /// Get the name of the current app @@ -2456,7 +2456,7 @@ class App { } /// Parse "one" argument (some may eat more than one), delegate to parent if fails, add to missing if missing - /// from master return false if the parse has failed and needs to return to parent + /// from main return false if the parse has failed and needs to return to parent bool _parse_single(std::vector &args, bool &positional_only) { bool retval = true; detail::Classifier classifier = positional_only ? detail::Classifier::NONE : _recognize(args.back()); @@ -2731,7 +2731,7 @@ class App { } } } - // If a subcommand, try the master command + // If a subcommand, try the main command if(parent_ != nullptr && fallthrough_) return _get_fallthrough_parent()->_parse_arg(args, current_type); // don't capture missing if this is a nameless subcommand diff --git a/include/CLI/TypeTools.hpp b/include/CLI/TypeTools.hpp index 2b87ec60..0fa22997 100644 --- a/include/CLI/TypeTools.hpp +++ b/include/CLI/TypeTools.hpp @@ -36,7 +36,7 @@ constexpr enabler dummy = {}; /// A copy of enable_if_t from C++14, compatible with C++11. /// /// We could check to see if C++14 is being used, but it does not hurt to redefine this -/// (even Google does this: https://github.com/google/skia/blob/master/include/private/SkTLogic.h) +/// (even Google does this: https://github.com/google/skia/blob/main/include/private/SkTLogic.h) /// It is not in the std namespace anyway, so no harm done. template using enable_if_t = typename std::enable_if::type;