| 163 | } |
| 164 | |
| 165 | void 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 | |
| 184 | std::string Flag::documentConfigText(const std::string& configText) |
| 185 | { |
no test coverage detected