mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 23:00:42 -08:00
* feat(server): add version endpoint * fix panic and test * move version.go * move version variable * add docs about endpoints * move testdata * refactor * update build command * refactor
25 lines
560 B
Go
25 lines
560 B
Go
//go:build mage_docs
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/spf13/cobra/doc"
|
|
|
|
"github.com/aquasecurity/trivy/pkg/commands"
|
|
"github.com/aquasecurity/trivy/pkg/flag"
|
|
"github.com/aquasecurity/trivy/pkg/log"
|
|
)
|
|
|
|
// Generate CLI references
|
|
func main() {
|
|
// Set a dummy path for the documents
|
|
flag.CacheDirFlag.Default = "/path/to/cache"
|
|
flag.ModuleDirFlag.Default = "$HOME/.trivy/modules"
|
|
|
|
cmd := commands.NewApp()
|
|
cmd.DisableAutoGenTag = true
|
|
if err := doc.GenMarkdownTree(cmd, "./docs/docs/references/configuration/cli"); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|