From 1123d0231db03aef3d8887147db45566791f3a91 Mon Sep 17 00:00:00 2001
From: Hugo Trentesaux <hugo@trentesaux.fr>
Date: Tue, 24 Oct 2023 12:47:48 +0200
Subject: [PATCH] document address overwrite behavior

---
 doc/config.md  | 27 +++++++++++++++++++++++++++
 doc/example.md |  2 +-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 doc/config.md

diff --git a/doc/config.md b/doc/config.md
new file mode 100644
index 0000000..541c0a0
--- /dev/null
+++ b/doc/config.md
@@ -0,0 +1,27 @@
+# Äžcli config 
+
+Some Äžcli commands require to have an address configured (for example to get account balance), some require to have a secret configured (to sign extrinsics).
+Äžcli allows to save what you want in a config file and to overwrite parts in command line arguments. Example:
+
+```sh
+# save Alice secret to config file
+cargo run -- -S predefined -s Alice config save
+
+# show config 
+cargo run -- config show
+# [stdout]
+# Äžcli config
+# duniter endpoint ws://localhost:9944
+# indexer endpoint http://localhost:8080/v1/graphql
+# address 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY (secret defined)
+
+# use different address in command line
+cargo run -- --address 5Fxune7f71ZbpP2FoY3mhYcmM596Erhv1gRue4nsPwkxMR4n config show
+# [stdout]
+# Äžcli config
+# duniter endpoint ws://localhost:9944
+# indexer endpoint http://localhost:8080/v1/graphql
+# address 5Fxune7f71ZbpP2FoY3mhYcmM596Erhv1gRue4nsPwkxMR4n (no secret)
+```
+
+You can see that if a secret is defined, the associated address is used, but if an other address is given, the secret is silenced.
\ No newline at end of file
diff --git a/doc/example.md b/doc/example.md
index 51cf095..7d3ea45 100644
--- a/doc/example.md
+++ b/doc/example.md
@@ -20,7 +20,7 @@ gcli -S predefined -s Alice config save
 gcli --network local -S predefined -s test1 config save
 ```
 
-In the following, we assume this last command was run.
+In the following, we assume this last command was run. More about the config in [config.md](./config.md).
 
 ## Commands
 
-- 
GitLab