Reference
Console
Parameters:
-
(themeOptional[Theme], default:None) –The theme to use for the console output.
Methods:
-
display_arguments_table–Display the arguments table for the CLI tool.
-
display_header–Display Header Information for a CLI tool.
-
display_help–Display the help message for a CLI tool.
-
display_options_table–Display the options table for the CLI tool.
-
display_subcommands_table–Display the subcommands table for the CLI tool.
-
display_usage–Display the usage information for the CLI tool.
-
display_version–Display the version of the CLI tool.
-
error–Display an error message in the console.
-
info–Display an informational message in the console.
-
print–Display rich text in the console
-
success–Display a success message in the console.
-
warning–Display a warning message in the console.
Attributes:
-
theme–
Source code in saiuncli/console.py
display_arguments_table
display_arguments_table(
arguments: Optional[List[Argument]] = None,
) -> None
Display the arguments table for the CLI tool. Args: arguments (Optional[List[Argument]]): The arguments to display.
Source code in saiuncli/console.py
display_header
display_header(
title: str,
description: Optional[str] = None,
version: Optional[str] = None,
) -> None
Display Header Information for a CLI tool. Args: title (str): The title of the CLI tool. description (Optional[str]): A brief description of the CLI tool. version (Optional[str]): The version of the CLI tool.
Source code in saiuncli/console.py
display_help
display_help(
title: str = None,
usage: str = None,
description: Optional[str] = None,
version: Optional[str] = None,
options: Optional[str] = None,
arguments: Optional[str] = None,
subcommands: Optional[str] = None,
show_header: bool = True,
help_flags: Optional[List[str]] = None,
version_flags: Optional[List[str]] = None,
) -> None
Display the help message for a CLI tool.
Parameters:
-
(titlestr, default:None) –The title of the CLI tool.
-
(usagestr, default:None) –The usage information for the CLI tool.
-
(descriptionOptional[str], default:None) –A brief description of the CLI tool.
-
(versionOptional[str], default:None) –The version of the CLI tool.
-
(optionsOptional[List[Option]], default:None) –The options available for the CLI tool.
-
(argumentsOptional[List[Argument]], default:None) –The arguments available for the CLI tool.
-
(subcommandsOptional[List[Command]], default:None) –The subcommands available for the CLI tool.
-
(show_headerbool, default:True) –Whether to display the header information.
-
(help_flagsOptional[List[str]], default:None) –The help flags for the CLI tool.
-
(version_flagsOptional[List[str]], default:None) –The version flags for the CLI tool.
Source code in saiuncli/console.py
display_options_table
display_options_table(
options: Optional[List[Option]],
version_flags: Optional[List[str]] = None,
help_flags: Optional[List[str]] = None,
) -> None
Display the options table for the CLI tool.
Parameters:
-
(optionsOptional[List[Option]]) –The options to display.
-
(version_flagsOptional[List[str]], default:None) –The version flags for the CLI tool.
-
(help_flagsOptional[List[str]], default:None) –The help flags for the CLI tool.
Source code in saiuncli/console.py
display_subcommands_table
display_subcommands_table(
subcommands: Optional[List[Command]] = None,
) -> None
Display the subcommands table for the CLI tool. Args: subcommands (Optional[List[Command]]): The subcommands to display.
Source code in saiuncli/console.py
display_usage
Display the usage information for the CLI tool. Args: usage (str): The usage information for the CLI tool.
display_version
Display the version of the CLI tool. Args: version (str): The version of the CLI tool.
Source code in saiuncli/console.py
error
Display an error message in the console.
info
Display an informational message in the console.
print
Display rich text in the console
Wraps the rich console print method to allow for custom styling.
Parameters:
-
(*objectsAny, default:()) –The objects to print to the console.
-
(styleOptional[str], default:None) –The style to apply to the text.
-
(**kwargsAny, default:{}) –Additional keyword arguments for the print method.
Source code in saiuncli/console.py
success
Display a success message in the console.
warning
Display a warning message in the console.