mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 10:00:40 +02:00
Dev/document autocomplete (#1004)
* fixed the gendoc to reflect the new parser, updated documentation to include info about autocomplete in the command line part, error in createing docs * fixed list deprecated, fixed command help (to show properly on a html, fixed other help warnings * minor indents --------- Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
parent
0b9fd0664e
commit
6fcdba56a4
@ -8,7 +8,7 @@ Commands can be used either with sls_detector_get or sls_detector_put
|
|||||||
|
|
||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
sls_detector_get vrf
|
sls_detector_get exptime
|
||||||
|
|
||||||
Help
|
Help
|
||||||
--------
|
--------
|
||||||
@ -24,6 +24,16 @@ Help
|
|||||||
# get help for a particular command
|
# get help for a particular command
|
||||||
sls_detector_get -h fpath
|
sls_detector_get -h fpath
|
||||||
sls_detector_help fpath
|
sls_detector_help fpath
|
||||||
|
|
||||||
|
# list of deprecated commands
|
||||||
|
list deprecated
|
||||||
|
|
||||||
|
# autocompletion
|
||||||
|
# bash_autocomplete.sh or zsh_autocomplete.sh must be sourced from the
|
||||||
|
# main package folder to enable auto completion of commands and arguments
|
||||||
|
# for the command line on that shell.
|
||||||
|
source bash_autocomplete.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Commands
|
Commands
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "CmdProxy.h"
|
#include "Caller.h"
|
||||||
#include "sls/Detector.h"
|
#include "sls/Detector.h"
|
||||||
#include "sls/sls_detector_defs.h"
|
#include "sls/sls_detector_defs.h"
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ int main() {
|
|||||||
|
|
||||||
std::cout << "Generating command line documentation!\n";
|
std::cout << "Generating command line documentation!\n";
|
||||||
|
|
||||||
sls::CmdProxy proxy(nullptr);
|
sls::Caller caller(nullptr);
|
||||||
auto commands = proxy.GetProxyCommands();
|
auto commands = caller.getAllCommands();
|
||||||
|
|
||||||
std::ofstream fs("commands.rst");
|
std::ofstream fs("commands.rst");
|
||||||
fs << ".. glossary::\n";
|
fs << ".. glossary::\n";
|
||||||
@ -46,7 +46,7 @@ int main() {
|
|||||||
for (const auto &cmd : commands) {
|
for (const auto &cmd : commands) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
std::cout << cmd << '\n';
|
std::cout << cmd << '\n';
|
||||||
proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
|
caller.call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
|
||||||
|
|
||||||
auto tmp = os.str().erase(0, cmd.size());
|
auto tmp = os.str().erase(0, cmd.size());
|
||||||
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
||||||
@ -57,7 +57,7 @@ int main() {
|
|||||||
|
|
||||||
std::ofstream fs2("deprecated.csv");
|
std::ofstream fs2("deprecated.csv");
|
||||||
fs2 << "Old, New\n";
|
fs2 << "Old, New\n";
|
||||||
auto cmds = proxy.GetDeprecatedCommands();
|
auto cmds = caller.GetDeprecatedCommands();
|
||||||
for (auto it : cmds) {
|
for (auto it : cmds) {
|
||||||
fs2 << it.first << ", " << it.second << '\n';
|
fs2 << it.first << ", " << it.second << '\n';
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ ZMQ: Json Header Format
|
|||||||
| | [From detector udp header] |
|
| | [From detector udp header] |
|
||||||
+--------------+----------------------------------------------+
|
+--------------+----------------------------------------------+
|
||||||
| detType | Detector type enum |
|
| detType | Detector type enum |
|
||||||
| detSpec3 | See :ref:`Detector enum<Detector Enum>` |
|
| detSpec3 | See :ref:`Detector enum<detector enum>` |
|
||||||
| | [From detector udp header] |
|
| | [From detector udp header] |
|
||||||
+--------------+----------------------------------------------+
|
+--------------+----------------------------------------------+
|
||||||
| version | Detector header version. At 2 |
|
| version | Detector header version. At 2 |
|
||||||
|
@ -63,6 +63,8 @@ Description
|
|||||||
* **version**: current version of the detector header (0x2).
|
* **version**: current version of the detector header (0x2).
|
||||||
|
|
||||||
|
|
||||||
|
.. _detector enum:
|
||||||
|
|
||||||
Detector Enum
|
Detector Enum
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ class Caller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> getAllCommands();
|
std::vector<std::string> getAllCommands();
|
||||||
|
std::map<std::string, std::string> GetDeprecatedCommands();
|
||||||
std::string list(int action);
|
std::string list(int action);
|
||||||
|
|
||||||
// THIS COMMENT TO BE REPLACED BY THE ACTUAL CODE (1)
|
// THIS COMMENT TO BE REPLACED BY THE ACTUAL CODE (1)
|
||||||
|
@ -793,7 +793,7 @@ selinterface:
|
|||||||
input_types: [ bool ]
|
input_types: [ bool ]
|
||||||
|
|
||||||
udp_firstdst:
|
udp_firstdst:
|
||||||
help: "\n[0 - 31 (or number of udp destinations)]\n\t[Jungfrau][Moench][Gotthard2]\n[0-63]\n\t[Mythen3]\n\n\t One can set which is the first destination that the detector will stream images out from in a round robin fashion. The entry must not have been empty. Default: 0"
|
help: "\n\t[0 - N]\n\twhere N is the max number of udp destinations - 1.\n\t[Jungfrau][Moench][Gotthard2] Max number of udp destinations is 32.\n\t[Mythen3] Max number of udp destination is 64.\n\t One can set which is the first destination that the detector will stream images out from in a round robin fashion. The entry must not have been empty. Default: 0"
|
||||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
@ -1074,7 +1074,7 @@ interruptsubframe:
|
|||||||
input_types: [ bool ]
|
input_types: [ bool ]
|
||||||
|
|
||||||
activate:
|
activate:
|
||||||
help: "[0, 1] \n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."
|
help: "[0, 1]\n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."
|
||||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
@ -1779,7 +1779,7 @@ udp_validate:
|
|||||||
|
|
||||||
clearroi:
|
clearroi:
|
||||||
inherit_actions: EXECUTE_SET_COMMAND
|
inherit_actions: EXECUTE_SET_COMMAND
|
||||||
help: "[Gotthard] Resets Region of interest in detector. All channels enabled. Default is all channels enabled."
|
help: "\n\t[Gotthard] Resets Region of interest in detector. All channels enabled. Default is all channels enabled."
|
||||||
actions:
|
actions:
|
||||||
PUT:
|
PUT:
|
||||||
function: clearROI
|
function: clearROI
|
||||||
@ -2034,7 +2034,7 @@ framecounter:
|
|||||||
################# GET_COMMAND_HEX ############################
|
################# GET_COMMAND_HEX ############################
|
||||||
serialnumber:
|
serialnumber:
|
||||||
inherit_actions: GET_COMMAND
|
inherit_actions: GET_COMMAND
|
||||||
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\nSerial number of detector."
|
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\n\tSerial number of detector."
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
function: getSerialNumber
|
function: getSerialNumber
|
||||||
@ -3429,7 +3429,7 @@ udp_dstlist:
|
|||||||
output: [ ToString(args) ]
|
output: [ ToString(args) ]
|
||||||
|
|
||||||
txdelay:
|
txdelay:
|
||||||
help: "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules in the detector using the step size provided.Sets up \n\t\t[Eiger] txdelay_left to (2 * mod_index * n_delay), \n\t\t[Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay) and \n\t\t[Eiger] txdelay_frame to (2 *num_modules * n_delay) \n\t\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay) \nfor every module."
|
help: "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules in the detector using the step size provided.Sets up \n\t[Eiger] txdelay_left to (2 * mod_index * n_delay), \n\t[Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay) and \n\t[Eiger] txdelay_frame to (2 *num_modules * n_delay)\n\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay) for every module."
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
argc: 0
|
argc: 0
|
||||||
@ -3963,7 +3963,7 @@ patloop:
|
|||||||
output: [level,"' '" , "'['" , "ToStringHex(start, 4)" , '", "' , "ToStringHex(stop, 4)", "']'" ]
|
output: [level,"' '" , "'['" , "ToStringHex(start, 4)" , '", "' , "ToStringHex(stop, 4)", "']'" ]
|
||||||
|
|
||||||
patloop0:
|
patloop0:
|
||||||
help: "Deprecated command. Use patloop."
|
help: "\n\tDeprecated command. Use patloop."
|
||||||
inherit_actions: patloop
|
inherit_actions: patloop
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
@ -4010,7 +4010,7 @@ patnloop:
|
|||||||
output: [ level,"' '" , nloops ]
|
output: [ level,"' '" , nloops ]
|
||||||
|
|
||||||
patnloop0:
|
patnloop0:
|
||||||
help: "Deprecated command. Use patnloop."
|
help: "\n\tDeprecated command. Use patnloop."
|
||||||
inherit_actions: patnloop
|
inherit_actions: patnloop
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
@ -4056,7 +4056,7 @@ patwait:
|
|||||||
output: [level,"' '" , "ToStringHex(addr, 4)" ]
|
output: [level,"' '" , "ToStringHex(addr, 4)" ]
|
||||||
|
|
||||||
patwait0:
|
patwait0:
|
||||||
help: "Deprecated command. Use patwait."
|
help: "\n\tDeprecated command. Use patwait."
|
||||||
inherit_actions: patwait
|
inherit_actions: patwait
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
@ -4102,7 +4102,7 @@ patwaittime:
|
|||||||
output: [level,"' '" , "waittime" ]
|
output: [level,"' '" , "waittime" ]
|
||||||
|
|
||||||
patwaittime0:
|
patwaittime0:
|
||||||
help: "Deprecated command. Use patwaittime."
|
help: "\n\tDeprecated command. Use patwaittime."
|
||||||
inherit_actions: patwaittime
|
inherit_actions: patwaittime
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
|
@ -67,8 +67,7 @@ activate:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: activate
|
command_name: activate
|
||||||
function_alias: activate
|
function_alias: activate
|
||||||
help: "[0, 1] \n\t[Eiger] 1 is default. 0 deactivates readout and does not send\
|
help: "[0, 1]\n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."
|
||||||
\ data."
|
|
||||||
infer_action: true
|
infer_action: true
|
||||||
template: true
|
template: true
|
||||||
adcclk:
|
adcclk:
|
||||||
@ -1206,8 +1205,8 @@ clearroi:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: clearroi
|
command_name: clearroi
|
||||||
function_alias: clearroi
|
function_alias: clearroi
|
||||||
help: '[Gotthard] Resets Region of interest in detector. All channels enabled. Default
|
help: "\n\t[Gotthard] Resets Region of interest in detector. All channels enabled.\
|
||||||
is all channels enabled.'
|
\ Default is all channels enabled."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
template: true
|
template: true
|
||||||
clientversion:
|
clientversion:
|
||||||
@ -6078,7 +6077,7 @@ patloop0:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patloop0
|
command_name: patloop0
|
||||||
function_alias: patloop0
|
function_alias: patloop0
|
||||||
help: Deprecated command. Use patloop.
|
help: "\n\tDeprecated command. Use patloop."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patloop1:
|
patloop1:
|
||||||
actions:
|
actions:
|
||||||
@ -6147,7 +6146,7 @@ patloop1:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patloop1
|
command_name: patloop1
|
||||||
function_alias: patloop1
|
function_alias: patloop1
|
||||||
help: Deprecated command. Use patloop.
|
help: "\n\tDeprecated command. Use patloop."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patloop2:
|
patloop2:
|
||||||
actions:
|
actions:
|
||||||
@ -6216,7 +6215,7 @@ patloop2:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patloop2
|
command_name: patloop2
|
||||||
function_alias: patloop2
|
function_alias: patloop2
|
||||||
help: Deprecated command. Use patloop.
|
help: "\n\tDeprecated command. Use patloop."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patmask:
|
patmask:
|
||||||
actions:
|
actions:
|
||||||
@ -6377,7 +6376,7 @@ patnloop0:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patnloop0
|
command_name: patnloop0
|
||||||
function_alias: patnloop0
|
function_alias: patnloop0
|
||||||
help: Deprecated command. Use patnloop.
|
help: "\n\tDeprecated command. Use patnloop."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patnloop1:
|
patnloop1:
|
||||||
actions:
|
actions:
|
||||||
@ -6435,7 +6434,7 @@ patnloop1:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patnloop1
|
command_name: patnloop1
|
||||||
function_alias: patnloop1
|
function_alias: patnloop1
|
||||||
help: Deprecated command. Use patnloop.
|
help: "\n\tDeprecated command. Use patnloop."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patnloop2:
|
patnloop2:
|
||||||
actions:
|
actions:
|
||||||
@ -6493,7 +6492,7 @@ patnloop2:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patnloop2
|
command_name: patnloop2
|
||||||
function_alias: patnloop2
|
function_alias: patnloop2
|
||||||
help: Deprecated command. Use patnloop.
|
help: "\n\tDeprecated command. Use patnloop."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patsetbit:
|
patsetbit:
|
||||||
actions:
|
actions:
|
||||||
@ -6700,7 +6699,7 @@ patwait0:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patwait0
|
command_name: patwait0
|
||||||
function_alias: patwait0
|
function_alias: patwait0
|
||||||
help: Deprecated command. Use patwait.
|
help: "\n\tDeprecated command. Use patwait."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patwait1:
|
patwait1:
|
||||||
actions:
|
actions:
|
||||||
@ -6758,7 +6757,7 @@ patwait1:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patwait1
|
command_name: patwait1
|
||||||
function_alias: patwait1
|
function_alias: patwait1
|
||||||
help: Deprecated command. Use patwait.
|
help: "\n\tDeprecated command. Use patwait."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patwait2:
|
patwait2:
|
||||||
actions:
|
actions:
|
||||||
@ -6816,7 +6815,7 @@ patwait2:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patwait2
|
command_name: patwait2
|
||||||
function_alias: patwait2
|
function_alias: patwait2
|
||||||
help: Deprecated command. Use patwait.
|
help: "\n\tDeprecated command. Use patwait."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patwaittime:
|
patwaittime:
|
||||||
actions:
|
actions:
|
||||||
@ -6937,7 +6936,7 @@ patwaittime0:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patwaittime0
|
command_name: patwaittime0
|
||||||
function_alias: patwaittime0
|
function_alias: patwaittime0
|
||||||
help: Deprecated command. Use patwaittime.
|
help: "\n\tDeprecated command. Use patwaittime."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patwaittime1:
|
patwaittime1:
|
||||||
actions:
|
actions:
|
||||||
@ -6995,7 +6994,7 @@ patwaittime1:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patwaittime1
|
command_name: patwaittime1
|
||||||
function_alias: patwaittime1
|
function_alias: patwaittime1
|
||||||
help: Deprecated command. Use patwaittime.
|
help: "\n\tDeprecated command. Use patwaittime."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patwaittime2:
|
patwaittime2:
|
||||||
actions:
|
actions:
|
||||||
@ -7053,7 +7052,7 @@ patwaittime2:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: patwaittime2
|
command_name: patwaittime2
|
||||||
function_alias: patwaittime2
|
function_alias: patwaittime2
|
||||||
help: Deprecated command. Use patwaittime.
|
help: "\n\tDeprecated command. Use patwaittime."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
patword:
|
patword:
|
||||||
actions:
|
actions:
|
||||||
@ -9754,7 +9753,7 @@ serialnumber:
|
|||||||
store_result_in_t: true
|
store_result_in_t: true
|
||||||
command_name: serialnumber
|
command_name: serialnumber
|
||||||
function_alias: serialnumber
|
function_alias: serialnumber
|
||||||
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\nSerial number\
|
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\n\tSerial number\
|
||||||
\ of detector."
|
\ of detector."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
template: true
|
template: true
|
||||||
@ -11913,11 +11912,11 @@ txdelay:
|
|||||||
command_name: txdelay
|
command_name: txdelay
|
||||||
function_alias: txdelay
|
function_alias: txdelay
|
||||||
help: "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for\
|
help: "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for\
|
||||||
\ all modules in the detector using the step size provided.Sets up \n\t\t[Eiger]\
|
\ all modules in the detector using the step size provided.Sets up \n\t[Eiger]\
|
||||||
\ txdelay_left to (2 * mod_index * n_delay), \n\t\t[Eiger] txdelay_right to ((2\
|
\ txdelay_left to (2 * mod_index * n_delay), \n\t[Eiger] txdelay_right to ((2\
|
||||||
\ * mod_index + 1) * n_delay) and \n\t\t[Eiger] txdelay_frame to (2 *num_modules\
|
\ * mod_index + 1) * n_delay) and \n\t[Eiger] txdelay_frame to (2 *num_modules\
|
||||||
\ * n_delay) \n\t\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules\
|
\ * n_delay)\n\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay)\
|
||||||
\ * n_delay) \nfor every module."
|
\ for every module."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
txdelay_frame:
|
txdelay_frame:
|
||||||
actions:
|
actions:
|
||||||
@ -12417,10 +12416,11 @@ udp_firstdst:
|
|||||||
store_result_in_t: false
|
store_result_in_t: false
|
||||||
command_name: udp_firstdst
|
command_name: udp_firstdst
|
||||||
function_alias: udp_firstdst
|
function_alias: udp_firstdst
|
||||||
help: "\n[0 - 31 (or number of udp destinations)]\n\t[Jungfrau][Moench][Gotthard2]\n\
|
help: "\n\t[0 - N]\n\twhere N is the max number of udp destinations - 1.\n\t[Jungfrau][Moench][Gotthard2]\
|
||||||
[0-63]\n\t[Mythen3]\n\n\t One can set which is the first destination that the\
|
\ Max number of udp destinations is 32.\n\t[Mythen3] Max number of udp destination\
|
||||||
\ detector will stream images out from in a round robin fashion. The entry must\
|
\ is 64.\n\t One can set which is the first destination that the detector will\
|
||||||
\ not have been empty. Default: 0"
|
\ stream images out from in a round robin fashion. The entry must not have been\
|
||||||
|
\ empty. Default: 0"
|
||||||
infer_action: true
|
infer_action: true
|
||||||
template: true
|
template: true
|
||||||
udp_numdst:
|
udp_numdst:
|
||||||
|
@ -60,7 +60,6 @@ def generate(
|
|||||||
if command["help"].startswith('code:'):
|
if command["help"].startswith('code:'):
|
||||||
codegen.write_line(command["help"].strip('code:'))
|
codegen.write_line(command["help"].strip('code:'))
|
||||||
else:
|
else:
|
||||||
codegen.write_line(f'os << "Command: {command_name}" << std::endl;')
|
|
||||||
codegen.write_line(f'os << R"V0G0N({command["help"]} )V0G0N" << std::endl;')
|
codegen.write_line(f'os << R"V0G0N({command["help"]} )V0G0N" << std::endl;')
|
||||||
codegen.write_line('return os.str();')
|
codegen.write_line('return os.str();')
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -55,6 +55,7 @@ class Caller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> getAllCommands();
|
std::vector<std::string> getAllCommands();
|
||||||
|
std::map<std::string, std::string> GetDeprecatedCommands();
|
||||||
std::string list(int action);
|
std::string list(int action);
|
||||||
|
|
||||||
std::string acquire(int action);
|
std::string acquire(int action);
|
||||||
|
@ -16,6 +16,10 @@ std::vector<std::string> Caller::getAllCommands() {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<std::string, std::string> Caller::GetDeprecatedCommands() {
|
||||||
|
return deprecated_functions;
|
||||||
|
}
|
||||||
|
|
||||||
void Caller::call(const std::string &command,
|
void Caller::call(const std::string &command,
|
||||||
const std::vector<std::string> &arguments, int detector_id,
|
const std::vector<std::string> &arguments, int detector_id,
|
||||||
int action, std::ostream &os, int receiver_id) {
|
int action, std::ostream &os, int receiver_id) {
|
||||||
@ -63,12 +67,35 @@ bool Caller::ReplaceIfDeprecated(std::string &command) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string Caller::list(int action) {
|
std::string Caller::list(int action) {
|
||||||
std::string ret = "free\n";
|
if (action == defs::HELP_ACTION) {
|
||||||
for (auto &f : functions) {
|
return "[deprecated(optional)]\n\tlists all available commands, list "
|
||||||
ret += f.first + "\n";
|
"deprecated - list deprecated commands\n";
|
||||||
|
}
|
||||||
|
if (args.empty()) {
|
||||||
|
std::string ret = "free\n";
|
||||||
|
for (auto &f : functions) {
|
||||||
|
ret += f.first + "\n";
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
} else if (args.size() == 1) {
|
||||||
|
if (args[0] == "deprecated") {
|
||||||
|
std::ostringstream os;
|
||||||
|
os << "The following " << deprecated_functions.size()
|
||||||
|
<< " commands are deprecated\n";
|
||||||
|
const size_t field_width = 20;
|
||||||
|
for (const auto &it : deprecated_functions) {
|
||||||
|
os << std::right << std::setw(field_width) << it.first << " -> "
|
||||||
|
<< it.second << '\n';
|
||||||
|
}
|
||||||
|
return os.str();
|
||||||
|
} else {
|
||||||
|
throw RuntimeError(
|
||||||
|
"Could not decode argument. Possible options: deprecated");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
WrongNumberOfParameters(0);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Network Configuration (Detector<->Receiver) */
|
/* Network Configuration (Detector<->Receiver) */
|
||||||
|
1
zsh_autocomplete.sh
Symbolic link
1
zsh_autocomplete.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
slsDetectorSoftware/generator/autocomplete/zsh_autocomplete.sh
|
Loading…
x
Reference in New Issue
Block a user