Skip to content

Commit e8acb2a

Browse files
spencergilbertjszwedko
authored andcommitted
Use env vars with validate command (#8577)
Signed-off-by: Spencer Gilbert <[email protected]>
1 parent efac075 commit e8acb2a

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/validate.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,37 @@ pub struct Opts {
2323
deny_warnings: bool,
2424

2525
/// Vector config files in TOML format to validate.
26-
#[structopt(name = "config-toml", long, use_delimiter(true))]
26+
#[structopt(
27+
name = "config-toml",
28+
long,
29+
env = "VECTOR_CONFIG_TOML",
30+
use_delimiter(true)
31+
)]
2732
paths_toml: Vec<PathBuf>,
2833

2934
/// Vector config files in JSON format to validate.
30-
#[structopt(name = "config-json", long, use_delimiter(true))]
35+
#[structopt(
36+
name = "config-json",
37+
long,
38+
env = "VECTOR_CONFIG_JSON",
39+
use_delimiter(true)
40+
)]
3141
paths_json: Vec<PathBuf>,
3242

3343
/// Vector config files in YAML format to validate.
34-
#[structopt(name = "config-yaml", long, use_delimiter(true))]
44+
#[structopt(
45+
name = "config-yaml",
46+
long,
47+
env = "VECTOR_CONFIG_YAML",
48+
use_delimiter(true)
49+
)]
3550
paths_yaml: Vec<PathBuf>,
3651

3752
/// Any number of Vector config files to validate.
3853
/// Format is detected from the file name.
3954
/// If none are specified the default config path `/etc/vector/vector.toml`
4055
/// will be targeted.
41-
#[structopt(use_delimiter(true))]
56+
#[structopt(env = "VECTOR_CONFIG", use_delimiter(true))]
4257
paths: Vec<PathBuf>,
4358

4459
/// Read configuration from files in one or more directories.

0 commit comments

Comments
 (0)