mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 12:41:02 +02:00
Update tg-show-flow-classes CLI
This commit is contained in:
parent
a029cc8094
commit
11201fe982
1 changed files with 11 additions and 8 deletions
|
|
@ -72,23 +72,26 @@ def show_flow_classes(url):
|
||||||
for class_name in class_names:
|
for class_name in class_names:
|
||||||
cls = flow_api.get_class(class_name)
|
cls = flow_api.get_class(class_name)
|
||||||
|
|
||||||
print(f"Flow Class: {class_name}")
|
table = []
|
||||||
print(f"Description: {cls.get('description', 'No description')}")
|
table.append(("name", class_name))
|
||||||
|
table.append(("description", cls.get("description", "")))
|
||||||
|
|
||||||
tags = cls.get("tags", [])
|
tags = cls.get("tags", [])
|
||||||
if tags:
|
if tags:
|
||||||
print(f"Tags: {', '.join(tags)}")
|
table.append(("tags", ", ".join(tags)))
|
||||||
|
|
||||||
# Show parameters if they exist
|
# Show parameters if they exist
|
||||||
parameters = cls.get("parameters", {})
|
parameters = cls.get("parameters", {})
|
||||||
if parameters:
|
if parameters:
|
||||||
print("Parameters:")
|
|
||||||
param_str = format_parameters(parameters, config_api)
|
param_str = format_parameters(parameters, config_api)
|
||||||
print(param_str)
|
table.append(("parameters", param_str))
|
||||||
else:
|
|
||||||
print("Parameters: None")
|
|
||||||
|
|
||||||
print() # Blank line between flow classes
|
print(tabulate.tabulate(
|
||||||
|
table,
|
||||||
|
tablefmt="pretty",
|
||||||
|
stralign="left",
|
||||||
|
))
|
||||||
|
print()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue