Skip to content

Commit

Permalink
Use env vars with validate command (vectordotdev#8577)
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Gilbert <spencer.gilbert@datadoghq.com>
Signed-off-by: dbcfd <bdbrowning2@gmail.com>
  • Loading branch information
spencergilbert authored and dbcfd committed Aug 18, 2021
1 parent cdf46ed commit a10df50
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf>,

/// 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<PathBuf>,

/// 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<PathBuf>,

/// 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<PathBuf>,

/// Read configuration from files in one or more directories.
Expand Down

0 comments on commit a10df50

Please sign in to comment.