added function to read depreciated commands

This commit is contained in:
Erik Frojdh 2020-10-30 11:50:42 +01:00
parent d93fd4c655
commit 139db216fe
3 changed files with 11 additions and 0 deletions

View File

@ -51,4 +51,10 @@ int main() {
auto help = replace_all(tmp, "\n\t", "\n\t\t| ");
fs << '\t' << cmd << usage << help << "\n";
}
std::ofstream fs2("depreciated.txt");
auto cmds = proxy.GetDepreciatedCommands();
for (auto it : cmds){
fs2 << it.first << ", " << it.second << '\n';
}
}

View File

@ -74,6 +74,10 @@ std::vector<std::string> CmdProxy::GetProxyCommands() {
return commands;
}
std::map<std::string, std::string> CmdProxy::GetDepreciatedCommands(){
return depreciated_functions;
}
void CmdProxy::WrongNumberOfParameters(size_t expected) {
throw RuntimeError(
"Command " + cmd + " expected <=" + std::to_string(expected) +

View File

@ -534,6 +534,7 @@ class CmdProxy {
bool ReplaceIfDepreciated(std::string &command);
size_t GetFunctionMapSize() const noexcept { return functions.size(); };
std::vector<std::string> GetProxyCommands();
std::map<std::string, std::string> GetDepreciatedCommands();
private:
Detector *det;