Unreachable();
}
-inline std::string suggestTags(char const* const* validTags, std::string inputTag)
+inline std::string suggestTags(char const* const* validTags, std::string inputTag,
+ char const* const* additionalTags = NULL)
{
DidYouMean didYouMean;
for(size_t i = 0; (opt = validTags[i]) != NULL; ++i) {
didYouMean.addWord(validTags[i]);
}
+ if(additionalTags != NULL) {
+ for(size_t i = 0; (opt = additionalTags[i]) != NULL; ++i) {
+ didYouMean.addWord(additionalTags[i]);
+ }
+ }
return didYouMean.getMatchAsString(inputTag);
}
!Configuration::isTraceTag(optarg.c_str())) {
throw OptionException(std::string("debug tag ") + optarg +
std::string(" not available.") +
- suggestTags(Configuration::getDebugTags(), optarg) );
+ suggestTags(Configuration::getDebugTags(), optarg, Configuration::getTraceTags()) );
}
} else if(! Configuration::isDebugBuild()) {
throw OptionException("debug tags not available in non-debug builds");
didYouMean.addWord(std::string("--") + cmdlineOptions[i].name);
}
- return didYouMean.getMatchAsString(optionName);
+ return didYouMean.getMatchAsString(optionName.substr(0, optionName.find('=')));
}
static const char* smtOptions[] = {