powercli.common¶
Common commands and flags.
Module Contents¶
Classes¶
A help command. |
|
A help flag which on presence prints a help message and exits. |
|
A version command. |
|
A version flag which on presence prints the version and exits.. |
|
A list command. |
|
A list flag which on presence prints all available subcommands. |
API¶
- class powercli.common.HelpCommand(status: int = 0, name: str = 'help', description: str = 'Prints a help message for the given command', hidden_aliases: set[str] = {'?'}, **kwargs: Any)¶
Bases:
powercli.command.Command[typing.Any,typing.Any]A help command.
Initialization
Initializes the help command.
Parameters
status- The status the program exits with when the help command is invoked.
All other arguments are passed to
powercli.command.Commandwith some defaults.
- class powercli.common.HelpFlag(status: int = 0, short: str | None = 'h', long: str | None = 'help', short_hidden_aliases: set[str] = {'?'}, description: str | None = 'Prints a help message and exits', **kwargs: Any)¶
Bases:
powercli.args.Flag[typing.Any,typing.Any,None]A help flag which on presence prints a help message and exits.
Initialization
Initializes the help flag.
Parameters
status- The status the program exits with when the help command is invoked.
All other arguments are passed to
powercli.args.Flagwith some defaults.
- class powercli.common.VersionCommand(version: str, name: str = 'version', description: str | None = 'Prints the version and exits', **kwargs: Any)¶
Bases:
powercli.command.Command[typing.Any,typing.Any]A version command.
Initialization
Initializes the version command.
Parameters
version- The version to display.
All other arguments are passed to
powercli.command.Commandwith some defaults.
- class powercli.common.VersionFlag(version: str, long: str | None = 'version', description: str | None = 'Prints the version and exits', **kwargs: Any)¶
Bases:
powercli.args.Flag[typing.Any,typing.Any,None]A version flag which on presence prints the version and exits..
Initialization
Initializes the version flag.
Parameters
version- The version to display.
All other arguments are passed to
powercli.args.Flagwith some defaults.
- class powercli.common.ListCommand(name: str = 'list', description: str | None = 'Lists all subcommands', **kwargs: Any)¶
Bases:
powercli.command.Command[typing.Any,typing.Any]A list command.
Initialization
Initializes the list command.
- class powercli.common.ListFlag(short: str | None = 'l', long: str | None = 'list', description: str | None = 'Lists all subcommands and exits', **kwargs: Any)¶
Bases:
powercli.args.Flag[typing.Any,typing.Any,None]A list flag which on presence prints all available subcommands.
Initialization
Initializes the list flag.