MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / writeToConfig

Method writeToConfig

src/utils/cli.cpp:165–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void Flag::writeToConfig(json& conf)
166{
167 // Choose the verbose version over the smaller one
168 std::string flag = m_VerboseFlag.empty() ? m_Flag : m_VerboseFlag;
169
170 if (m_DefaultValues.empty() || m_ConfigSection.empty())
171 return; // Don't write these into the config, they don't want to be there
172
173 if (conf.find(m_ConfigSection) == conf.end())
174 conf[m_ConfigSection] = json::object();
175
176 if (m_nParams == 0)
177 conf[m_ConfigSection][flag] = isSet();
178 else if (m_nParams == 1)
179 conf[m_ConfigSection][flag] = m_ParsedArgs[0];
180 else
181 conf[m_ConfigSection][flag] = m_ParsedArgs;
182}
183
184std::string Flag::documentConfigText(const std::string& configText)
185{

Callers 1

writeConfigFileMethod · 0.80

Calls 3

findMethod · 0.80
emptyMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected