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.Groupwith a name and version.This decorator adds a version option and the
--configoption (ifuse_config_fileis True) to the command group. The--configoption 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
--configoption for specifying a top-level configuration file.use_debug_mode (bool) – Whether to enable the
--debug/--no-debugoption 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.