From da2f1283b9c7c811a337c6c6a1aa60c3829e4e1c Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Mon, 2 Oct 2023 20:52:27 +0200
Subject: [PATCH] Set general --gtest and --endpoint options as mutually
 exclusives

---
 silkaj/cli.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/silkaj/cli.py b/silkaj/cli.py
index 62894cc6..39dd3de0 100644
--- a/silkaj/cli.py
+++ b/silkaj/cli.py
@@ -19,7 +19,7 @@ from pathlib import Path
 import rich_click as click
 from duniterpy.api.endpoint import endpoint as du_endpoint
 
-from silkaj import tui
+from silkaj import tools, tui
 from silkaj.about import about
 from silkaj.auth import generate_auth_file
 from silkaj.blockchain.blocks import list_blocks
@@ -77,6 +77,8 @@ click.rich_click.OPTION_GROUPS = {
 {tui.endpoint_link(du_endpoint(G1_DEFAULT_ENDPOINT).host)}. \
 --endpoint allows to specify a custom endpoint following the format: <host>:<port>/<path>. \
 <port> and <path> are optional. In case no port is specified, it defaults to 443.",
+    cls=tools.MutuallyExclusiveOption,
+    mutually_exclusive=["gtest"],
 )
 @click.option(
     "--gtest",
@@ -85,6 +87,8 @@ click.rich_click.OPTION_GROUPS = {
     help=f"Uses official ÄžTest currency endpoint: \
 {tui.endpoint_link(du_endpoint(G1_TEST_DEFAULT_ENDPOINT).host)}. \
 Note that --endpoint has precedence over --gtest.",
+    cls=tools.MutuallyExclusiveOption,
+    mutually_exclusive=["endpoint"],
 )
 @click.option(
     "--auth-scrypt",
-- 
GitLab