Currently, we are documenting CLI scripts by copy-pasting their help output, which is of course error prone.
All of them in protopipe and its interface to (CTA-)DIRAC (which is documented in the same place) are based on argparse.
As soon as the high-level refactoring from ctapipe starts, we should be able to do the same for traitlets-based Applications (see also cta-observatory/ctapipe#1904).
Caveats
the proposed solution (but also other similar projects) expects that any argparse.ArgumentParser is returned by a global function or stored in a global variable which is not what we do (we only define the parser within the main function)
Until #168 is open, the usage descriptions of the CLI scripts which belong to the (CTA)DIRAC interface will need to be updated the old-fashioned way.
Description
Currently, we are documenting CLI scripts by copy-pasting their help output, which is of course error prone. All of them in protopipe and its interface to (CTA-)DIRAC (which is documented in the same place) are based on
argparse
.Luckily there seems to be a Sphinx plugin also for this which could be a possible solution: https://sphinxcontrib-autoprogram.readthedocs.io/en/stable/
As soon as the high-level refactoring from ctapipe starts, we should be able to do the same for
traitlets
-based Applications (see also cta-observatory/ctapipe#1904).Caveats
argparse.ArgumentParser
is returned by a global function or stored in a global variable which is not what we do (we only define the parser within the main function)