StrictDoc Documentation
strictdoc/commands/about_command.py
Source file coverage
Path:
strictdoc/commands/about_command.py
Lines:
48
Non-empty lines:
37
Non-empty lines covered with requirements:
37 / 37 (100.0%)
Functions:
4
Functions covered by requirements:
4 / 4 (100.0%)
1
"""
2
@relation(SDOC-SRS-163, scope=file)
3
"""
4
 
5
import argparse
6
 
7
import strictdoc
8
from strictdoc.cli.base_command import BaseCommand
9
from strictdoc.helpers.parallelizer import Parallelizer
10
from strictdoc.helpers.timing import SimpleNominalExit
11
 
12
 
13
class AboutCommand(BaseCommand):
14
    HELP = "About StrictDoc."
15
    DETAILED_HELP = HELP
16
 
17
    @classmethod
18
    def add_arguments(cls, parser: argparse.ArgumentParser) -> None:
19
        pass
20
 
21
    def __init__(self, args: argparse.Namespace) -> None:
22
        self.args = args
23
 
24
    def run(self, parallelizer: Parallelizer) -> None:  # noqa: ARG002
25
        width = 72
26
        border = "═" * width
27
 
28
        lines = [
29
            f" {'StrictDoc'.center(width - 2)} ",
30
            "",
31
            " Purpose: Software for writing technical requirements specifications.",
32
            "",
33
            f" Version:      {strictdoc.__version__}",
34
            " Docs:         https://strictdoc.readthedocs.io/en/stable/",
35
            " GitHub:       https://github.com/strictdoc-project/strictdoc",
36
            " Mailing list: https://groups.io/g/strictdoc",
37
            " License:      Apache 2",
38
        ]
39
 
40
        banner = (
41
            f"╔{border}\n"
42
            + "\n".join(f"║{line.ljust(width)}║" for line in lines)
43
            + f"\n{border}╝"
44
        )
45
 
46
        print(banner)  # noqa: T201
47
 
48
        raise SimpleNominalExit