diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 19947599..3f7b080f 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -28,7 +28,7 @@ rand = { workspace = true } # CLI specific dependencies magic-wormhole = { path = "..", version = "0.7", features = ["all", "entropy"] } -clap = { workspace = true, features = ["cargo", "derive", "help"] } +clap = { workspace = true, features = ["cargo", "derive", "help", "env"] } clap_complete = { workspace = true } env_logger = { workspace = true } console = { workspace = true } diff --git a/cli/src/main.rs b/cli/src/main.rs index c15aeba7..7653e33f 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -120,10 +120,11 @@ struct CommonArgs { action = clap::ArgAction::Append, value_name = "tcp://HOSTNAME:PORT", value_hint = clap::ValueHint::Url, + env = "WORMHOLE_RELAY_URL", )] relay_server: Vec, /// Use a custom rendezvous server. Both sides need to use the same value in order to find each other. - #[arg(long, value_name = "ws://example.org", value_hint = clap::ValueHint::Url)] + #[arg(long, value_name = "ws://example.org", value_hint = clap::ValueHint::Url, env = "WORMHOLE_MAILBOX_URL")] rendezvous_server: Option, /// Disable the relay server support and force a direct connection. #[arg(long)]