1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 12:43:52 +00:00

Run clang-format script

This commit is contained in:
Henry Fredrick Schreiner 2017-12-23 09:47:52 -06:00
parent f16f9e223a
commit b10b9c8291
2 changed files with 16 additions and 15 deletions

View File

@ -809,7 +809,8 @@ class App {
/// Produce a string that could be read in as a config of the current values of the App. Set default_also to include
/// default arguments. Prefix will add a string to the beginning of each option.
std::string config_to_str(bool default_also = false, std::string prefix = "", bool write_description = false) const {
std::string
config_to_str(bool default_also = false, std::string prefix = "", bool write_description = false) const {
std::stringstream out;
for(const Option_p &opt : options_) {
@ -841,9 +842,9 @@ class App {
value = "false";
}
if (value.size() != 0) {
if (write_description && opt->has_description()) {
if (out.tellp() != 0) {
if(value.size() != 0) {
if(write_description && opt->has_description()) {
if(out.tellp() != 0) {
out << std::endl;
}
out << "; " << opt->get_description() << std::endl;

View File

@ -576,14 +576,14 @@ TEST_F(TApp, IniOutputNoConfigurable) {
}
TEST_F(TApp, IniOutputShortSingleDescription) {
std::string flag = "some_flag";
std::string description = "Some short description.";
app.add_flag("--" + flag, description);
std::string flag = "some_flag";
std::string description = "Some short description.";
app.add_flag("--" + flag, description);
run();
run();
std::string str = app.config_to_str(true, "", true);
EXPECT_THAT(str, HasSubstr("; " + description + "\n" + flag + "=false\n"));
std::string str = app.config_to_str(true, "", true);
EXPECT_THAT(str, HasSubstr("; " + description + "\n" + flag + "=false\n"));
}
TEST_F(TApp, IniOutputShortDoubleDescription) {