refactor: add allowed values for CLI flags (#4800)

* refactor: rename Value to Default

* refactor: support allowed values for CLI flags

* docs: auto-generate

* test: fix

* test: add tests for flags
This commit is contained in:
Teppei Fukuda
2023-07-17 16:13:23 +03:00
committed by GitHub
parent 4cecd17ea5
commit aca11b95d0
38 changed files with 468 additions and 294 deletions

View File

@@ -17,8 +17,8 @@ func main() {
log.Fatal(err)
}
// Set a dummy path for the documents
flag.CacheDirFlag.Value = "/path/to/cache"
flag.ModuleDirFlag.Value = "$HOME/.trivy/modules"
flag.CacheDirFlag.Default = "/path/to/cache"
flag.ModuleDirFlag.Default = "$HOME/.trivy/modules"
cmd := commands.NewApp(ver)
cmd.DisableAutoGenTag = true