LinchPin Command Line Shell implementation

The linchpin.shell module contains calls to implement the Command Line Interface within linchpin. It uses the Click command line interface composer. All calls here interface with the LinchPin Command-Line API API.

class linchpin.shell.click_default_group.DefaultGroup(*args, **kwargs)

Invokes a subcommand marked with default=True if any subcommand not chosen.

Parameters

default_if_no_args – resolves to the default command if no arguments passed.

command(*args, **kwargs)

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.

format_commands(ctx, formatter)

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

get_command(ctx, cmd_name)

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

list_commands(ctx)

Provide a list of available commands. Anything deprecated should not be listed

parse_args(ctx, args)

Given a context and a list of arguments this creates the parser and parses the arguments, then modifies the context as necessary. This is automatically invoked by make_context().

resolve_command(ctx, args)
set_default_command(command)

Sets a command function as the default command.