From 25d28531a1e042f74cb0ea6543f74a450d682d72 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Mon, 7 Nov 2022 23:41:52 +0300 Subject: [PATCH] cli: fallback to environment variable --- Cargo.toml | 2 +- src/cli.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 842935b..fc6b11e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ categories = ["command-line-interface", "config", "development-tools"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "3.2.15", default-features = false, features = ["std", "derive"] } +clap = { version = "3.2.15", default-features = false, features = ["std", "env", "derive"] } [features] color = ["clap/color"] diff --git a/src/cli.rs b/src/cli.rs index a3b268d..e0d0b2a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -39,6 +39,7 @@ pub struct Args { short = 'f', long, default_value = ".env", + env = "VNETOD_FILE", help = "Change source file with environment variables" )] pub file: PathBuf,