mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-04 22:23:52 +00:00
style: pre-commit.ci fixes
This commit is contained in:
parent
72c78a2484
commit
279e710544
@ -1240,10 +1240,11 @@ class App {
|
|||||||
CLI11_NODISCARD bool check_name(std::string name_to_check) const;
|
CLI11_NODISCARD bool check_name(std::string name_to_check) const;
|
||||||
|
|
||||||
/// @brief enumeration of matching possibilities
|
/// @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
|
/// 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;
|
CLI11_NODISCARD NameMatch check_name_detail(std::string name_to_check) const;
|
||||||
|
|
||||||
/// Get the groups available directly from this option (in order)
|
/// Get the groups available directly from this option (in order)
|
||||||
|
@ -335,7 +335,6 @@ TEST_CASE_METHOD(TApp, "DuplicateSubcommandCallbacksValues", "[subcom]") {
|
|||||||
CHECK(36 == vals[2]);
|
CHECK(36 == vals[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE_METHOD(TApp, "Callbacks", "[subcom]") {
|
TEST_CASE_METHOD(TApp, "Callbacks", "[subcom]") {
|
||||||
auto *sub1 = app.add_subcommand("sub1");
|
auto *sub1 = app.add_subcommand("sub1");
|
||||||
sub1->callback([]() { throw CLI::Success(); });
|
sub1->callback([]() { throw CLI::Success(); });
|
||||||
@ -1878,12 +1877,11 @@ TEST_CASE_METHOD(TApp, "DuplicateErrorsPrefix", "[subcom]") {
|
|||||||
auto *sub1 = app.add_subcommand("sub_test");
|
auto *sub1 = app.add_subcommand("sub_test");
|
||||||
auto *sub2 = app.add_subcommand("sub_deploy");
|
auto *sub2 = app.add_subcommand("sub_deploy");
|
||||||
|
|
||||||
|
|
||||||
CHECK_THROWS_AS(app.add_subcommand("sub"), CLI::OptionAlreadyAdded);
|
CHECK_THROWS_AS(app.add_subcommand("sub"), CLI::OptionAlreadyAdded);
|
||||||
// cannot alias to an existing subcommand
|
// cannot alias to an existing subcommand
|
||||||
CHECK_THROWS_AS(sub2->alias("sub"), CLI::OptionAlreadyAdded);
|
CHECK_THROWS_AS(sub2->alias("sub"), CLI::OptionAlreadyAdded);
|
||||||
app.ignore_case();
|
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();
|
sub2->ignore_case();
|
||||||
CHECK_THROWS_AS(sub1->alias("SUB_"), CLI::OptionAlreadyAdded);
|
CHECK_THROWS_AS(sub1->alias("SUB_"), CLI::OptionAlreadyAdded);
|
||||||
app.ignore_underscore();
|
app.ignore_underscore();
|
||||||
@ -1940,8 +1938,6 @@ TEST_CASE_METHOD(TApp, "AliasErrorsInOptionGroup", "[subcom]") {
|
|||||||
CHECK_THROWS_AS(sub2->name("sub1"), CLI::OptionAlreadyAdded);
|
CHECK_THROWS_AS(sub2->name("sub1"), CLI::OptionAlreadyAdded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("SharedSubTests: SharedSubcommand", "[subcom]") {
|
TEST_CASE("SharedSubTests: SharedSubcommand", "[subcom]") {
|
||||||
double val{0.0}, val2{0.0}, val3{0.0}, val4{0.0};
|
double val{0.0}, val2{0.0}, val3{0.0}, val4{0.0};
|
||||||
CLI::App app1{"test program1"};
|
CLI::App app1{"test program1"};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user