From 49b460364b2ddd60e8d50ebeae20948f1ff89020 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Mon, 17 Oct 2022 18:55:09 +0200
Subject: [PATCH] (cli) Organize commands under groups (#430)

---
 silkaj/cli.py | 50 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/silkaj/cli.py b/silkaj/cli.py
index 99b25232..dc8e563e 100644
--- a/silkaj/cli.py
+++ b/silkaj/cli.py
@@ -125,24 +125,48 @@ def cli(
 
 
 cli.add_command(about)
-cli.add_command(argos_info)
 cli.add_command(generate_auth_file)
-cli.add_command(cmd_amount)
-cli.add_command(list_blocks)
-cli.add_command(send_certification)
 cli.add_command(checksum_command)
-cli.add_command(difficulties)
-cli.add_command(transaction_history)
-cli.add_command(id_pubkey_correspondence)
-cli.add_command(currency_info)
 cli.add_command(license_command)
-cli.add_command(send_membership)
-cli.add_command(send_transaction)
-cli.add_command(verify_blocks_signatures)
-cli.add_command(received_sent_certifications)
 
 
-@cli.group(
+@cli.group("blockchain", help="Blockchain related commands")
+@help_option("-h", "--help")
+def blockchain_group() -> None:
+    pass
+
+
+blockchain_group.add_command(argos_info)
+blockchain_group.add_command(list_blocks)
+blockchain_group.add_command(difficulties)
+blockchain_group.add_command(currency_info)
+blockchain_group.add_command(verify_blocks_signatures)
+
+
+@cli.group("money", help="Money management related commands")
+@help_option("-h", "--help")
+def money_group() -> None:
+    pass
+
+
+money_group.add_command(cmd_amount)
+money_group.add_command(transaction_history)
+money_group.add_command(send_transaction)
+
+
+@cli.group("wot", help="Web-of-Trust related commands")
+@help_option("-h", "--help")
+def wot_group() -> None:
+    pass
+
+
+wot_group.add_command(send_certification)
+wot_group.add_command(id_pubkey_correspondence)
+wot_group.add_command(send_membership)
+wot_group.add_command(received_sent_certifications)
+
+
+@wot_group.group(
     "revocation",
     help="Create, save, verify or publish revocation document.\n\
 Subcommands optionally take the path to the revocation document.",
-- 
GitLab