pestifer.cli.subcommand module

Base class for all pestifer subcommands.

class pestifer.cli.subcommand.Subcommand(name: str, aliases: list = <factory>, log_file: str = 'pestifer_diagnostics.log', short_help: str = '', long_help: str = '', func_returns_type: type = <class 'bool'>, parser: argparse.ArgumentParser = None)[source]

Bases: ABC

abstractmethod add_subparser(subparsers: ArgumentParser) ArgumentParser[source]

Adds the subcommand parser to the given subparsers. Subclasses declare arguments here, after a super().add_subparser() call.

aliases: list

alternative names for this subcommand

static func(args: Namespace, **kwargs)[source]

the function that executes the subcommand. Subclasses must implement this method.

func_returns_type

the return type of the func method

alias of bool

log_file: str = 'pestifer_diagnostics.log'

default log file for this subcommand

long_help: str = ''

description

name: str

subcommand name

parser: ArgumentParser = None

the subparser for this subcommand

short_help: str = ''

help string