1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-04 14:23:51 +00:00

style: pre-commit.ci fixes

This commit is contained in:
pre-commit-ci[bot] 2025-05-01 12:23:27 +00:00
parent 72c78a2484
commit 279e710544
2 changed files with 4 additions and 7 deletions

View File

@ -1240,10 +1240,11 @@ class App {
CLI11_NODISCARD bool check_name(std::string name_to_check) const;
/// @brief enumeration of matching possibilities
enum class NameMatch:std::uint8_t{none=0,exact=1,prefix=2};
enum class NameMatch : std::uint8_t { none = 0, exact = 1, prefix = 2 };
/// Check the name, case-insensitive and underscore insensitive if set
/// @return NameMatch::none if no match, NameMatch::exact if the match is exact NameMatch::prefix if prefix is enabled and a prefix matches
/// @return NameMatch::none if no match, NameMatch::exact if the match is exact NameMatch::prefix if prefix is
/// enabled and a prefix matches
CLI11_NODISCARD NameMatch check_name_detail(std::string name_to_check) const;
/// Get the groups available directly from this option (in order)

View File

@ -335,7 +335,6 @@ TEST_CASE_METHOD(TApp, "DuplicateSubcommandCallbacksValues", "[subcom]") {
CHECK(36 == vals[2]);
}
TEST_CASE_METHOD(TApp, "Callbacks", "[subcom]") {
auto *sub1 = app.add_subcommand("sub1");
sub1->callback([]() { throw CLI::Success(); });
@ -1878,12 +1877,11 @@ TEST_CASE_METHOD(TApp, "DuplicateErrorsPrefix", "[subcom]") {
auto *sub1 = app.add_subcommand("sub_test");
auto *sub2 = app.add_subcommand("sub_deploy");
CHECK_THROWS_AS(app.add_subcommand("sub"), CLI::OptionAlreadyAdded);
// cannot alias to an existing subcommand
CHECK_THROWS_AS(sub2->alias("sub"), CLI::OptionAlreadyAdded);
app.ignore_case();
//this needs to be opposite of the subcommand the alias is being tested on to check for ambiguity
// this needs to be opposite of the subcommand the alias is being tested on to check for ambiguity
sub2->ignore_case();
CHECK_THROWS_AS(sub1->alias("SUB_"), CLI::OptionAlreadyAdded);
app.ignore_underscore();
@ -1940,8 +1938,6 @@ TEST_CASE_METHOD(TApp, "AliasErrorsInOptionGroup", "[subcom]") {
CHECK_THROWS_AS(sub2->name("sub1"), CLI::OptionAlreadyAdded);
}
TEST_CASE("SharedSubTests: SharedSubcommand", "[subcom]") {
double val{0.0}, val2{0.0}, val3{0.0}, val4{0.0};
CLI::App app1{"test program1"};