aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJill <kokakiwi@deuxfleurs.fr>2021-10-28 17:13:13 +0200
committerGitea <gitea@fake.local>2021-11-03 16:00:57 +0100
commitbef6d627b06997a0b98cbd5522a65c8db11e07b9 (patch)
treeaf8a7527aceef1954e85eea503f1c86008ba1932
parente93d7fb2289e7462b3f3c950f79cdbfa0400988c (diff)
downloadgarage-bef6d627b06997a0b98cbd5522a65c8db11e07b9.tar.gz
garage-bef6d627b06997a0b98cbd5522a65c8db11e07b9.zip
Add environment variables equivalents for some CLI options.
-rw-r--r--src/garage/main.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/garage/main.rs b/src/garage/main.rs
index 2a939730..70c959f8 100644
--- a/src/garage/main.rs
+++ b/src/garage/main.rs
@@ -30,15 +30,20 @@ use cli::*;
struct Opt {
/// Host to connect to for admin operations, in the format:
/// <public-key>@<ip>:<port>
- #[structopt(short = "h", long = "rpc-host")]
+ #[structopt(short = "h", long = "rpc-host", env = "GARAGE_RPC_HOST")]
pub rpc_host: Option<String>,
/// RPC secret network key for admin operations
- #[structopt(short = "s", long = "rpc-secret")]
+ #[structopt(short = "s", long = "rpc-secret", env = "GARAGE_RPC_SECRET")]
pub rpc_secret: Option<String>,
/// Configuration file (garage.toml)
- #[structopt(short = "c", long = "config", default_value = "/etc/garage.toml")]
+ #[structopt(
+ short = "c",
+ long = "config",
+ env = "GARAGE_CONFIG_FILE",
+ default_value = "/etc/garage.toml"
+ )]
pub config_file: PathBuf,
#[structopt(subcommand)]