Description

Very basic script demonstrating the multi-level help messages.

Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from tinyscript import *

__doc__ = "Main description"
__details__ = [
    "First level of details",
    "Second level of details",
]

if __name__ == '__main__':
    initialize()

Help

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
$ python multi-level-help.py -h
Tool

Main description

usage: ./tool.py [-h] [-v]

extra arguments:
  -h             show extended help message and exit (default: 0)
                  NB: -hhh is the highest help detail level
  -v, --verbose  verbose mode (default: False)
1
2
3
4
5
6
7
$ python multi-level-help.py -hh
Tool
[...]
  -v, --verbose  verbose mode (default: False)


First level of details
1
2
3
4
5
6
7
8
9
$ python multi-level-help.py -hh
Tool
[...]
  -v, --verbose  verbose mode (default: False)


First level of details

Second level of details