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

Remove flags from inifile

This commit is contained in:
Henry Fredrick Schreiner 2017-02-14 12:21:11 -05:00
parent b359039332
commit 1f510725e5
3 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
## Version 0.5 (in progress)
* Added `require_subcommand` to `App`, to simplify forcing subcommands. Do not "chain" with `add_subcommand`, since that is the subcommand, not the master `App`. Untested.
* Added printout of ini file text given parsed options, skips flags.
## Version 0.4

View File

@ -105,7 +105,7 @@ public:
std::string config_to_str() const {
std::stringstream out;
for(const Option_p &opt : options) {
if(opt->lnames.size() > 0 && opt->count() > 0)
if(opt->lnames.size() > 0 && opt->count() > 0 && opt->get_expected() > 0)
out << opt->lnames[0] << "=" << detail::join(opt->flatten_results()) << std::endl;
}
return out.str();

View File

@ -5,6 +5,7 @@
#include "gmock/gmock.h"
using ::testing::HasSubstr;
using ::testing::Not;
TEST(StringBased, First) {
std::stringstream ofile;
@ -165,6 +166,6 @@ TEST_F(TApp, IniOutputFlag) {
std::string str = app.config_to_str();
EXPECT_THAT(str, HasSubstr("simple=3"));
EXPECT_THAT(str, HasSubstr("nothing="));
EXPECT_THAT(str, Not(HasSubstr("nothing=")));
}