powercli._help_utils¶
Utilities for working with help messages.
Module Contents¶
Functions¶
Returns the length of an object. |
|
Returns the amount of columns of the terminal. |
|
Creates a help message for a command. |
|
Returns a “usage” line for a command. |
|
Returns the usage for a command. |
|
Returns examples of a command. |
|
Returns a descriptive information for a flag. |
|
Returns the values of a flag. |
|
Returns a descriptive information for a subcommand. |
|
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.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.