Click Utilities
elva.click_utils
Module holding wrappers and decorators for lazy loading command-line interface.
Functions:
-
lazy_cli
–Wrapper around
group
. -
elva_app_cli
–Wrapper around
group
withinvoke_without_command=True
. -
lazy_group_without_invoke
–Wrapper around
group
withinvoke_without_command=False
. -
lazy_group
–Decorator for a
Group
object fromelva_app_cli
. -
print_help
–Print help of function
f
withecho
, consideringf
's context
lazy_cli(f)
Wrapper around group
.
In addtion, the returned Group
object gets a lazy_load(import_name, **kwargs)
method being a wrapper around its group(cls=LazyGroup, import_name=import_name, invoke_without_command=True, **kwargs)
method.
invoke_without_command
is set to True
so that it can be set in the lazy loaded command.
Parameters:
-
f
(Callable
) –function used as a CLI command.
Returns:
-
Group
–click.group()
object with presets and shortcut methodlazy_load
Source code in src/elva/click_utils.py
elva_app_cli(**kwargs)
Wrapper around group
with invoke_without_command=True
.
Source code in src/elva/click_utils.py
lazy_group_without_invoke(**kwargs)
Wrapper around group
with invoke_without_command=False
.
Source code in src/elva/click_utils.py
lazy_group(**kwargs)
Decorator for a Group
object from elva_app_cli
.
Source code in src/elva/click_utils.py
print_help(f)
Print help of function f
with echo
, considering f
's context