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:
2024-10-21 16:39:50 +02:00
committed by GitHub
parent 0b9fd0664e
commit 6fcdba56a4
12 changed files with 137 additions and 375 deletions

View File

@ -8,7 +8,7 @@ Commands can be used either with sls_detector_get or sls_detector_put
.. code-block::
sls_detector_get vrf
sls_detector_get exptime
Help
--------
@ -24,6 +24,16 @@ Help
# get help for a particular command
sls_detector_get -h 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

View File

@ -11,7 +11,7 @@
#include <string>
#include <vector>
#include "CmdProxy.h"
#include "Caller.h"
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
@ -37,8 +37,8 @@ int main() {
std::cout << "Generating command line documentation!\n";
sls::CmdProxy proxy(nullptr);
auto commands = proxy.GetProxyCommands();
sls::Caller caller(nullptr);
auto commands = caller.getAllCommands();
std::ofstream fs("commands.rst");
fs << ".. glossary::\n";
@ -46,7 +46,7 @@ int main() {
for (const auto &cmd : commands) {
std::ostringstream os;
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 usage = tmp.substr(0, tmp.find_first_of('\n'));
@ -57,7 +57,7 @@ int main() {
std::ofstream fs2("deprecated.csv");
fs2 << "Old, New\n";
auto cmds = proxy.GetDeprecatedCommands();
auto cmds = caller.GetDeprecatedCommands();
for (auto it : cmds) {
fs2 << it.first << ", " << it.second << '\n';
}

View File

@ -213,7 +213,7 @@ ZMQ: Json Header Format
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detType | Detector type enum |
| detSpec3 | See :ref:`Detector enum<Detector Enum>` |
| detSpec3 | See :ref:`Detector enum<detector enum>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| version | Detector header version. At 2 |

View File

@ -63,6 +63,8 @@ Description
* **version**: current version of the detector header (0x2).
.. _detector enum:
Detector Enum
--------------