feat: parse home flag earlier (backport #20771) (#20777)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot]
2024-06-25 20:04:23 +00:00
committed by GitHub
co-authored by Julien Robert
parent 0e6db14834
commit e4c342eb99
18 changed files with 208 additions and 196 deletions
+2 -2
View File
@@ -153,7 +153,7 @@ Flags are added to commands directly (generally in the [module's CLI file](../..
## Environment variables
Each flag is bound to its respective named environment variable. Then name of the environment variable consist of two parts - capital case `basename` followed by flag name of the flag. `-` must be substituted with `_`. For example flag `--home` for application with basename `GAIA` is bound to `GAIA_HOME`. It allows reducing the amount of flags typed for routine operations. For example instead of:
Each flag is bound to its respective named environment variable. Then name of the environment variable consist of two parts - capital case `basename` followed by flag name of the flag. `-` must be substituted with `_`. For example flag `--node` for application with basename `GAIA` is bound to `GAIA_NODE`. It allows reducing the amount of flags typed for routine operations. For example instead of:
```shell
gaia --home=./ --node=<node address> --chain-id="testchain-1" --keyring-backend=test tx ... --from=<key name>
@@ -163,7 +163,7 @@ this will be more convenient:
```shell
# define env variables in .env, .envrc etc
GAIA_HOME=<path to home>
NODE_HOME=<path to home>
GAIA_NODE=<node address>
GAIA_CHAIN_ID="testchain-1"
GAIA_KEYRING_BACKEND="test"