mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 12:13:52 +00:00
Adding =false when printing config with defaults
This commit is contained in:
parent
ea033e5247
commit
ae5bf0ce62
@ -573,7 +573,12 @@ public:
|
||||
// Flag, multiple passed
|
||||
} else if(opt->count() > 1) {
|
||||
out << name << "=" << opt->count() << std::endl;
|
||||
|
||||
// Flag, not present
|
||||
} else if(opt->count() == 0 && default_also) {
|
||||
out << name << "=false" << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
for(const App_p &subcom : subcommands_)
|
||||
|
@ -520,6 +520,9 @@ TEST_F(TApp, IniOutputFlag) {
|
||||
EXPECT_THAT(str, Not(HasSubstr("nothing")));
|
||||
EXPECT_THAT(str, HasSubstr("onething=true"));
|
||||
EXPECT_THAT(str, HasSubstr("something=2"));
|
||||
|
||||
std::string str = app.config_to_str(true);
|
||||
EXPECT_THAT(str, HasSubstr("nothing"));
|
||||
}
|
||||
|
||||
TEST_F(TApp, IniOutputSet) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user