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:
parent
b359039332
commit
1f510725e5
@ -1,6 +1,7 @@
|
|||||||
## Version 0.5 (in progress)
|
## 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 `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
|
## Version 0.4
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ public:
|
|||||||
std::string config_to_str() const {
|
std::string config_to_str() const {
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
for(const Option_p &opt : options) {
|
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;
|
out << opt->lnames[0] << "=" << detail::join(opt->flatten_results()) << std::endl;
|
||||||
}
|
}
|
||||||
return out.str();
|
return out.str();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
|
|
||||||
using ::testing::HasSubstr;
|
using ::testing::HasSubstr;
|
||||||
|
using ::testing::Not;
|
||||||
|
|
||||||
TEST(StringBased, First) {
|
TEST(StringBased, First) {
|
||||||
std::stringstream ofile;
|
std::stringstream ofile;
|
||||||
@ -165,6 +166,6 @@ TEST_F(TApp, IniOutputFlag) {
|
|||||||
|
|
||||||
std::string str = app.config_to_str();
|
std::string str = app.config_to_str();
|
||||||
EXPECT_THAT(str, HasSubstr("simple=3"));
|
EXPECT_THAT(str, HasSubstr("simple=3"));
|
||||||
EXPECT_THAT(str, HasSubstr("nothing="));
|
EXPECT_THAT(str, Not(HasSubstr("nothing=")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user