From 0bc67f2ad0de2aadc9a79f23d302d5e04e04eee3 Mon Sep 17 00:00:00 2001 From: Jill Date: Thu, 28 Oct 2021 17:13:13 +0200 Subject: [PATCH] Add environment variables equivalents for some CLI options. --- src/garage/main.rs | 11 ++++++++--- 1 file 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: /// @: - #[structopt(short = "h", long = "rpc-host")] + #[structopt(short = "h", long = "rpc-host", env = "GARAGE_RPC_HOST")] pub rpc_host: Option, /// 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, /// 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)]