table.cmd
import table.cmd
table.cmd.default_table_args(set_dict={})
Gets default table arguments.
Return the tuple representing the default table arguments. The
set_dict can contain key/value elements overriding the default value. The key is the same as the name of the table argument in the command.
table.cmd.get_table_arg_value(arg, table_values)
Retrieve the value for a table command argument.
Allows the user command to look at a certain named parameter to get
its value. For example, to internally make use of the -verbose flag. The arg argument specifies the argument to fetch the value of. The table_values argument is the tuple of table arguments received in the table.new_table_command() callback function.
table.cmd.new_table_command(
command_name,
cmd_func,
args=None,
doc='',
sortable_columns=None,
**kwargs
)
Register a new command which prints a table.
Register a specific command for printing the table, with all the command arguments from the print-table commands, but extendable with personalized argument handling. For example, a dedicated command could print out additional data, or filter out certain rows from the table and only print those.
All arguments here are similar to the cli.new_command() function except the sortable_columns argument.
The cmd_func function will be called with additional table argument last. The function should use the table.show() to produce the table output according to the user arguments.
If the sortable_columns argument is supplied, it should contain a list of the column namnes which can be used for sorting. This is only used for the expander function. If this argument is not set, the default expander will try to use the table interface to retrieve the column names.
table.cmd.new_tech_preview_table_command(
name,
feature,
fun,
args=[],
doc='',
sortable_columns=None,
**kwargs
)
Define a new tech preview CLI table command.
table.cmd.new_unsupported_table_command(
name,
feature,
fun,
args=[],
doc='',
sortable_columns=None,
**kwargs
)
Define a new unsupported CLI table command.