powercli._help_utils

Utilities for working with help messages.

Module Contents

Functions

len

Returns the length of an object.

terminal_width

Returns the amount of columns of the terminal.

help_message

Creates a help message for a command.

usage

Returns a “usage” line for a command.

options

Returns the usage for a command.

examples

Returns examples of a command.

pretty_flag

Returns a descriptive information for a flag.

values

Returns the values of a flag.

commands

Returns a descriptive information for a subcommand.

positional_blocks

Returns a descriptive information of all positionals of a command.

Data

API

powercli._help_utils.PROMPT_PREFIX

‘$’

powercli._help_utils.len(x: Any, /) int

Returns the length of an object.

In case of a string, it ignores ANSI escape sequences.

powercli._help_utils.terminal_width() int

Returns the amount of columns of the terminal.

powercli._help_utils.help_message(cmd: powercli.command.Command[Any, Any]) str

Creates a help message for a command.

powercli._help_utils.usage(cmd: powercli.command.Command[Any, Any]) str

Returns a “usage” line for a command.

powercli._help_utils.options(cmd: powercli.command.Command[Any, Any]) str

Returns the usage for a command.

powercli._help_utils.examples(cmd: powercli.command.Command[Any, Any]) str

Returns examples of a command.

powercli._help_utils.pretty_flag(cmd: powercli.command.Command[Any, Any], flag: powercli.args.Flag[Any, Any, Any]) str

Returns a descriptive information for a flag.

powercli._help_utils.values(flag: powercli.args.Flag[Any, Any, Any]) str

Returns the values of a flag.

powercli._help_utils.commands(cmd: powercli.command.Command[Any, Any]) str

Returns a descriptive information for a subcommand.

powercli._help_utils.positional_blocks(cmd: powercli.command.Command[Any, Any]) str

Returns a descriptive information of all positionals of a command.