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)[source]

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)[source]

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

format_commands(ctx, formatter)[source]

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

get_command(ctx, cmd_name)[source]

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

list_commands(ctx)[source]

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

parse_args(ctx, args)[source]

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)[source]
set_default_command(command)[source]

Sets a command function as the default command.