find_work.cli.config#

Apply configuration to the command-line interface.

class find_work.cli.config.CustomFlag(flag_name: str, flag_obj: ConfigFlag)#

Bases: Option

Special kind of option that only overrides the value of another option.

handle_parse_result(ctx: Context, *args: Any, **kwargs: Any) tuple[Any, list[str]]#
class find_work.cli.config.ClickCustomFlagsGroup(*args: Any, config: ConfigRoot, **kwargs: Any)#

Bases: ClickAliasedGroup

Lazy-load custom global flags from the configuration.

get_params(ctx: Context) list[Parameter]#
class find_work.cli.config.ClickExecutorGroup(*args: Any, plugman: PluginManager, config: ConfigRoot, **kwargs: Any)#

Bases: Group

Lazy-load load custom aliases from the configuration.

list_commands(ctx: Context) list[str]#

Returns a list of subcommand names in the order they should appear.

get_command(ctx: Context, cmd_name: str) Command | None#

Given a context and a command name, this returns a Command object if it exists or returns None.

format_commands(ctx: Context, formatter: HelpFormatter) None#

Extra format methods for multi methods that adds all the commands after the options.

add_command(*args: Any, **kwargs: Any) NoReturn#

Registers another Command with this group. If the name is not provided, the name of the command is used.

command(*args: Any, **kwargs: Any) NoReturn#

A shortcut decorator for declaring and attaching a command to the group. This takes the same arguments as command() and immediately registers the created command with this group by calling add_command().

To customize the command class used, set the command_class attribute.

Changed in version 8.1: This decorator can be applied without parentheses.

Changed in version 8.0: Added the command_class attribute.

group(*args: Any, **kwargs: Any) NoReturn#

A shortcut decorator for declaring and attaching a group to the group. This takes the same arguments as group() and immediately registers the created group with this group by calling add_command().

To customize the group class used, set the group_class attribute.

Changed in version 8.1: This decorator can be applied without parentheses.

Changed in version 8.0: Added the group_class attribute.