mlsimkit.common.cli.program¶
- mlsimkit.common.cli.program(name, version, use_config_file=False, use_debug_mode=False, **attrs)¶
Decorator to turn a function into a program. A program is a
click.Group
with a name and version.This decorator adds a version option and the
--config
option (ifuse_config_file
is True) to the command group. The--config
option allows specifying a top-level configuration file that can be accessed by subgroups and subcommands.- Parameters:
name (str) – The name of the program.
version (str) – The version string for the program.
use_config_file (bool) – Whether to enable the
--config
option for specifying a top-level configuration file.use_debug_mode (bool) – Whether to enable the
--debug/--no-debug
option for catching exceptions from commands.attrs – Keyword arguments to pass to
group()
.
- Returns:
A decorator function that wraps a Click command group with the specified attributes and program metadata.