From 11201fe982d88763129778f93251c41c76e48dc9 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Fri, 26 Sep 2025 10:26:46 +0100 Subject: [PATCH] Update tg-show-flow-classes CLI --- .../trustgraph/cli/show_flow_classes.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/trustgraph-cli/trustgraph/cli/show_flow_classes.py b/trustgraph-cli/trustgraph/cli/show_flow_classes.py index f28459be..d9ce96a7 100644 --- a/trustgraph-cli/trustgraph/cli/show_flow_classes.py +++ b/trustgraph-cli/trustgraph/cli/show_flow_classes.py @@ -72,23 +72,26 @@ def show_flow_classes(url): for class_name in class_names: cls = flow_api.get_class(class_name) - print(f"Flow Class: {class_name}") - print(f"Description: {cls.get('description', 'No description')}") + table = [] + table.append(("name", class_name)) + table.append(("description", cls.get("description", ""))) tags = cls.get("tags", []) if tags: - print(f"Tags: {', '.join(tags)}") + table.append(("tags", ", ".join(tags))) # Show parameters if they exist parameters = cls.get("parameters", {}) if parameters: - print("Parameters:") param_str = format_parameters(parameters, config_api) - print(param_str) - else: - print("Parameters: None") + table.append(("parameters", param_str)) - print() # Blank line between flow classes + print(tabulate.tabulate( + table, + tablefmt="pretty", + stralign="left", + )) + print() def main():