From a10df507977adcdadb6a3e8f778a35e867e7cf51 Mon Sep 17 00:00:00 2001 From: Spencer Gilbert Date: Wed, 4 Aug 2021 10:32:23 -0400 Subject: [PATCH] Use env vars with validate command (#8577) Signed-off-by: Spencer Gilbert Signed-off-by: dbcfd --- src/validate.rs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/validate.rs b/src/validate.rs index e5775230beecf6..d2504437d50ed8 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -23,22 +23,37 @@ pub struct Opts { deny_warnings: bool, /// Vector config files in TOML format to validate. - #[structopt(name = "config-toml", long, use_delimiter(true))] + #[structopt( + name = "config-toml", + long, + env = "VECTOR_CONFIG_TOML", + use_delimiter(true) + )] paths_toml: Vec, /// Vector config files in JSON format to validate. - #[structopt(name = "config-json", long, use_delimiter(true))] + #[structopt( + name = "config-json", + long, + env = "VECTOR_CONFIG_JSON", + use_delimiter(true) + )] paths_json: Vec, /// Vector config files in YAML format to validate. - #[structopt(name = "config-yaml", long, use_delimiter(true))] + #[structopt( + name = "config-yaml", + long, + env = "VECTOR_CONFIG_YAML", + use_delimiter(true) + )] paths_yaml: Vec, /// Any number of Vector config files to validate. /// Format is detected from the file name. /// If none are specified the default config path `/etc/vector/vector.toml` /// will be targeted. - #[structopt(use_delimiter(true))] + #[structopt(env = "VECTOR_CONFIG", use_delimiter(true))] paths: Vec, /// Read configuration from files in one or more directories.