feat: parse home flag earlier (#20771)

This commit is contained in:
Julien Robert
2024-06-25 18:53:57 +00:00
committed by GitHub
parent 524a84c3ba
commit 5aaff21096
22 changed files with 87 additions and 99 deletions
+2 -2
View File
@@ -172,7 +172,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>
@@ -182,7 +182,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"