cli: fallback to environment variable

This commit is contained in:
Dmitriy Pleshevskiy 2022-11-07 23:41:52 +03:00
parent 6eddd4c2a0
commit 25d28531a1
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
2 changed files with 2 additions and 1 deletions

View file

@ -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 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [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] [features]
color = ["clap/color"] color = ["clap/color"]

View file

@ -39,6 +39,7 @@ pub struct Args {
short = 'f', short = 'f',
long, long,
default_value = ".env", default_value = ".env",
env = "VNETOD_FILE",
help = "Change source file with environment variables" help = "Change source file with environment variables"
)] )]
pub file: PathBuf, pub file: PathBuf,