2021-02-19 23:58:01 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2021-02-24 00:06:58 +00:00
|
|
|
// NewCLI creates a new instance of the root CLI
|
2023-05-02 09:00:14 +00:00
|
|
|
func NewCLI(version string) *cobra.Command {
|
2021-02-19 23:58:01 +00:00
|
|
|
rootCmd := &cobra.Command{
|
2021-02-27 18:11:49 +00:00
|
|
|
Use: "policyreporter",
|
|
|
|
Short: "Generates PolicyReport Metrics and Send Results to different targets",
|
|
|
|
Long: `Generates Prometheus Metrics from PolicyReports, ClusterPolicyReports and PolicyReportResults.
|
|
|
|
Sends notifications to different targets like Grafana's Loki.`,
|
2021-02-19 23:58:01 +00:00
|
|
|
}
|
|
|
|
|
2023-05-02 09:00:14 +00:00
|
|
|
rootCmd.AddCommand(newVersionCMD(version))
|
|
|
|
rootCmd.AddCommand(newRunCMD(version))
|
2022-07-03 21:49:16 +00:00
|
|
|
rootCmd.AddCommand(newSendCMD())
|
2021-02-19 23:58:01 +00:00
|
|
|
|
|
|
|
return rootCmd
|
|
|
|
}
|