From 708bc8f1f9e47451aab1b176e29f8d7974aba4c9 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Sat, 13 Mar 2021 13:24:49 +0100
Subject: [PATCH] [feat] #314: Add global --display/-d option to display the
 generated document

Before sending it
---
 silkaj/cli.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/silkaj/cli.py b/silkaj/cli.py
index 7389cc2c..4e51a238 100644
--- a/silkaj/cli.py
+++ b/silkaj/cli.py
@@ -86,8 +86,16 @@ from silkaj.constants import (
 )
 @option("--auth-seed", "--seed", is_flag=True, help="Seed hexadecimal authentication")
 @option("--auth-wif", "--wif", is_flag=True, help="WIF and EWIF authentication methods")
+@option(
+    "--display",
+    "-d",
+    is_flag=True,
+    help="Display the generated document before sending it",
+)
 @pass_context
-def cli(ctx, peer, gtest, auth_scrypt, nrp, auth_file, file, auth_seed, auth_wif):
+def cli(
+    ctx, peer, gtest, auth_scrypt, nrp, auth_file, file, auth_seed, auth_wif, display
+):
     ctx.obj = dict()
     ctx.ensure_object(dict)
     ctx.obj["PEER"] = peer
@@ -98,6 +106,7 @@ def cli(ctx, peer, gtest, auth_scrypt, nrp, auth_file, file, auth_seed, auth_wif
     ctx.obj["AUTH_FILE_PATH"] = file
     ctx.obj["AUTH_SEED"] = auth_seed
     ctx.obj["AUTH_WIF"] = auth_wif
+    ctx.obj["DISPLAY_DOCUMENT"] = display
 
 
 cli.add_command(argos_info)
-- 
GitLab