1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Let aggregator look for config files in similiar places like the other tools. (#440)

This commit is contained in:
Sascha L. Teichmann 2023-08-22 17:37:57 +02:00 committed by GitHub
parent f2657bb51a
commit 7d3c3a68df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -132,8 +132,9 @@ type config struct {
// configPaths are the potential file locations of the config file. // configPaths are the potential file locations of the config file.
var configPaths = []string{ var configPaths = []string{
// TODO: Make symmetric to checker and downloader. "~/.config/csaf/aggregator.toml",
"aggregator.toml", "~/.csaf_aggregator.toml",
"csaf_aggregator.toml",
} }
// parseArgsConfig parse the command arguments and loads configuration // parseArgsConfig parse the command arguments and loads configuration

View file

@ -15,6 +15,15 @@ Help Options:
-h, --help Show this help message -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: Usage example for a single run, to test if the config is good:
```bash ```bash
./csaf_aggregator -c docs/examples/aggregator.toml ./csaf_aggregator -c docs/examples/aggregator.toml