mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 20:53:52 +00:00
Using non-configurable to keep config and help out of config print
This commit is contained in:
parent
68207bdcc1
commit
14f1c9b88a
@ -357,8 +357,10 @@ class App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Empty name will simply remove the help flag
|
// Empty name will simply remove the help flag
|
||||||
if(!name.empty())
|
if(!name.empty()) {
|
||||||
help_ptr_ = add_flag(name, description);
|
help_ptr_ = add_flag(name, description);
|
||||||
|
help_ptr_->configurable(false);
|
||||||
|
}
|
||||||
|
|
||||||
return help_ptr_;
|
return help_ptr_;
|
||||||
}
|
}
|
||||||
@ -593,6 +595,7 @@ class App {
|
|||||||
config_name_ = default_filename;
|
config_name_ = default_filename;
|
||||||
config_required_ = required;
|
config_required_ = required;
|
||||||
config_ptr_ = add_option(name, config_name_, help, !default_filename.empty());
|
config_ptr_ = add_option(name, config_name_, help, !default_filename.empty());
|
||||||
|
config_ptr_->configurable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return config_ptr_;
|
return config_ptr_;
|
||||||
@ -833,7 +836,7 @@ class App {
|
|||||||
out << name << "=" << opt->count() << std::endl;
|
out << name << "=" << opt->count() << std::endl;
|
||||||
|
|
||||||
// Flag, not present
|
// Flag, not present
|
||||||
} else if(opt->count() == 0 && default_also && opt.get() != get_help_ptr()) {
|
} else if(opt->count() == 0 && default_also) {
|
||||||
out << name << "=false" << std::endl;
|
out << name << "=false" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user