diff --git a/moulinette/interfaces/__init__.py b/moulinette/interfaces/__init__.py index 02e0447b..25a307d0 100644 --- a/moulinette/interfaces/__init__.py +++ b/moulinette/interfaces/__init__.py @@ -260,11 +260,14 @@ class _ExtendedSubParsersAction(argparse._SubParsersAction): self._deprecated_command_map = {} def add_parser(self, name, type_=None, **kwargs): + hide_in_help = kwargs.pop("hide_in_help", False) deprecated = kwargs.pop("deprecated", False) deprecated_alias = kwargs.pop("deprecated_alias", []) if deprecated: self._deprecated_command_map[name] = None + + if deprecated or hide_in_help: if "help" in kwargs: del kwargs["help"] diff --git a/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py index ac6da9d6..18678085 100644 --- a/moulinette/interfaces/cli.py +++ b/moulinette/interfaces/cli.py @@ -364,6 +364,7 @@ class ActionsMapParser(BaseActionsMapParser): action_help=None, deprecated=False, deprecated_alias=[], + hide_in_help=False, **kwargs, ): """Add a parser for an action @@ -384,6 +385,7 @@ class ActionsMapParser(BaseActionsMapParser): description=action_help, deprecated=deprecated, deprecated_alias=deprecated_alias, + hide_in_help=hide_in_help, ) def add_global_arguments(self, arguments):