Skip to content

Commit

Permalink
Let aggregator look for config files in similiar places like the othe…
Browse files Browse the repository at this point in the history
…r tools. (#440)
  • Loading branch information
s-l-teichmann authored Aug 22, 2023
1 parent f2657bb commit 7d3c3a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/csaf_aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ type config struct {

// configPaths are the potential file locations of the config file.
var configPaths = []string{
// TODO: Make symmetric to checker and downloader.
"aggregator.toml",
"~/.config/csaf/aggregator.toml",
"~/.csaf_aggregator.toml",
"csaf_aggregator.toml",
}

// parseArgsConfig parse the command arguments and loads configuration
Expand Down
9 changes: 9 additions & 0 deletions docs/csaf_aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ Help Options:
-h, --help Show this help message
```

If no config file is explictly given the follwing places are searched for a config file:
```
~/.config/csaf/aggregator.toml
~/.csaf_aggregator.toml
csaf_aggregator.toml
```

with `~` expanding to `$HOME` on unixoid systems and `%HOMEPATH` on Windows systems.

Usage example for a single run, to test if the config is good:
```bash
./csaf_aggregator -c docs/examples/aggregator.toml
Expand Down

0 comments on commit 7d3c3a6

Please sign in to comment.