Merge pull request #211 from slsdetectorgroup/depdoc

Include depreciated commands in documentation
This commit is contained in:
Dhanya Thattil 2020-10-30 13:12:14 +01:00 committed by GitHub
commit 11a9d5bd4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 0 deletions

View File

@ -30,3 +30,18 @@ Commands
----------- -----------
.. include:: ../commands.rst .. include:: ../commands.rst
Depreciated commands
------------------------
.. note ::
All dac commands are preceded with the **dac** command. Use command **daclist** to get correct list of dac command arguments for current detector.
.. csv-table:: Depreciated commands
:file: ../depreciated.csv
:widths: 35, 35
:header-rows: 1

View File

@ -51,4 +51,11 @@ int main() {
auto help = replace_all(tmp, "\n\t", "\n\t\t| "); auto help = replace_all(tmp, "\n\t", "\n\t\t| ");
fs << '\t' << cmd << usage << help << "\n"; fs << '\t' << cmd << usage << help << "\n";
} }
std::ofstream fs2("depreciated.csv");
fs2 << "Old, New\n";
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; return commands;
} }
std::map<std::string, std::string> CmdProxy::GetDepreciatedCommands(){
return depreciated_functions;
}
void CmdProxy::WrongNumberOfParameters(size_t expected) { void CmdProxy::WrongNumberOfParameters(size_t expected) {
throw RuntimeError( throw RuntimeError(
"Command " + cmd + " expected <=" + std::to_string(expected) + "Command " + cmd + " expected <=" + std::to_string(expected) +

View File

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