MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / processCommon

Method processCommon

base/poco/Util/src/OptionProcessor.cpp:122–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120
121
122bool OptionProcessor::processCommon(const std::string& optionStr, bool isShort, std::string& optionName, std::string& optionArg)
123{
124 if (!_deferredOption.empty())
125 {
126 const Option& option = _options.getOption(_deferredOption, false);
127 std::string optionWithArg(_deferredOption);
128 _deferredOption.clear();
129 optionWithArg += '=';
130 optionWithArg += optionStr;
131 option.process(optionWithArg, optionArg);
132 optionName = option.fullName();
133 return true;
134 }
135 if (optionStr.empty()) throw EmptyOptionException();
136 const Option& option = _options.getOption(optionStr, isShort);
137 const std::string& group = option.group();
138 if (!group.empty())
139 {
140 if (_groups.find(group) != _groups.end())
141 throw IncompatibleOptionsException(option.fullName());
142 else
143 _groups.insert(group);
144 }
145 if (_specifiedOptions.find(option.fullName()) != _specifiedOptions.end() && !option.repeatable())
146 throw DuplicateOptionException(option.fullName());
147 _specifiedOptions.insert(option.fullName());
148 if (option.argumentRequired() && ((!isShort && optionStr.find_first_of(":=") == std::string::npos) || (isShort && optionStr.length() == option.shortName().length())))
149 {
150 _deferredOption = option.fullName();
151 return true;
152 }
153 option.process(optionStr, optionArg);
154 optionName = option.fullName();
155 return true;
156}
157
158
159} } // namespace Poco::Util

Callers

nothing calls this directly

Calls 10

repeatableMethod · 0.80
argumentRequiredMethod · 0.80
emptyMethod · 0.45
getOptionMethod · 0.45
clearMethod · 0.45
processMethod · 0.45
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected