From 397bc50289ba6181b1e8a6996d0957741da1d3a6 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Fri, 19 Sep 2025 11:04:13 +0100 Subject: [PATCH] Rename tg-update-collection to tg-set-collection --- trustgraph-cli/trustgraph/cli/set_collection.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trustgraph-cli/trustgraph/cli/set_collection.py b/trustgraph-cli/trustgraph/cli/set_collection.py index 094c033c..e987c4c8 100644 --- a/trustgraph-cli/trustgraph/cli/set_collection.py +++ b/trustgraph-cli/trustgraph/cli/set_collection.py @@ -1,5 +1,5 @@ """ -Update collection metadata +Set collection metadata (creates if doesn't exist) """ import argparse @@ -10,7 +10,7 @@ from trustgraph.api import Api default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/') default_user = "trustgraph" -def update_collection(url, user, collection, name, description, tags): +def set_collection(url, user, collection, name, description, tags): api = Api(url).collection() @@ -23,7 +23,7 @@ def update_collection(url, user, collection, name, description, tags): ) if result: - print(f"Collection '{collection}' updated successfully.") + print(f"Collection '{collection}' set successfully.") table = [] table.append(("Collection", result.collection)) @@ -39,18 +39,18 @@ def update_collection(url, user, collection, name, description, tags): maxcolwidths=[None, 67], )) else: - print(f"Failed to update collection '{collection}'.") + print(f"Failed to set collection '{collection}'.") def main(): parser = argparse.ArgumentParser( - prog='tg-update-collection', + prog='tg-set-collection', description=__doc__, ) parser.add_argument( 'collection', - help='Collection ID to update' + help='Collection ID to set' ) parser.add_argument( @@ -86,7 +86,7 @@ def main(): try: - update_collection( + set_collection( url = args.api_url, user = args.user, collection = args.collection,