ocebuild.cli._lib
#
Shared CLI utilities.
Module Contents#
Classes#
Shared CLI environment. |
Functions#
|
Factory for creating a shared environment for CLI commands. |
Attributes#
Shared context settings for the CLI. |
- class ocebuild.cli._lib.CLIEnv(verbose_flag: bool = VERBOSE, debug_flag: bool = DEBUG)[source]#
Shared CLI environment.
- ocebuild.cli._lib.cli_command(name: str | None = None)[source]#
Factory for creating a shared environment for CLI commands.
- Parameters:
name – The name of the command. Defaults to the function name.
- Returns:
A decorator for passing the CLI environment to commands.
Example
>>> @cli_command() ... def cli(env, *args, **kwargs): ... print(env) # -> <ocebuild.cli._lib.CLIEnv object at 0x108bf73d0>