From efaed58375930f767d358794ad99c59de3fb3b80 Mon Sep 17 00:00:00 2001 From: Dramelac Date: Mon, 8 Jul 2024 22:38:17 +0200 Subject: [PATCH] Add link to the official doc on -h Signed-off-by: Dramelac --- exegol/utils/argParse.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/exegol/utils/argParse.py b/exegol/utils/argParse.py index ca3aa63a..4d65f06f 100644 --- a/exegol/utils/argParse.py +++ b/exegol/utils/argParse.py @@ -1,8 +1,9 @@ import argparse -import argcomplete from logging import CRITICAL from typing import IO, Optional, List, Union, Dict, cast +import argcomplete + from exegol.console.cli.actions.Command import Command, Option from exegol.utils.ExeLog import logger @@ -19,8 +20,9 @@ def _print_message(self, message: str, file: Optional[IO[str]] = None) -> None: class Parser: """Custom Exegol CLI Parser. Main controller of argument building and parsing.""" - __description = "This Python script is a wrapper for Exegol. It can be used to easily manage Exegol on " \ - "your machine." + __description = """This Python script is a wrapper for Exegol. It can be used to easily manage Exegol on your machine. + +[red]Official documentation[/red]: https://exegol.rtfd.io""" __formatter_class = argparse.RawTextHelpFormatter def __init__(self, actions: List[Command]): @@ -54,7 +56,9 @@ def __set_action_parser(self) -> None: # the 'help' description of the current action is retrieved # from the comment of the corresponding action class sub_parser = self.subParser.add_parser(action.name, help=action.__doc__, - description=action.__doc__, + description=action.__doc__ + f""" + +[red]Official documentation[/red]: https://exegol.rtfd.io/en/latest/exegol-wrapper/{action.name}.html""", epilog=action.formatEpilog(), formatter_class=self.__formatter_class) sub_parser.set_defaults(action=action)