zotregistry.dev/zot@v1.4.4-0.20240314164342-eec277e14d20/pkg/cli/client/cves_cmd.go (about) 1 //go:build search 2 // +build search 3 4 package client 5 6 import ( 7 "github.com/spf13/cobra" 8 ) 9 10 func NewCVECommand(searchService SearchService) *cobra.Command { 11 cvesCmd := &cobra.Command{ 12 Use: "cve [command]", 13 Short: "Lookup CVEs in images hosted on the zot registry", 14 Long: `List CVEs (Common Vulnerabilities and Exposures) of images hosted on the zot registry`, 15 RunE: ShowSuggestionsIfUnknownCommand, 16 } 17 18 cvesCmd.SetUsageTemplate(cvesCmd.UsageTemplate() + usageFooter) 19 20 cvesCmd.PersistentFlags().String(URLFlag, "", 21 "Specify zot server URL if config-name is not mentioned") 22 cvesCmd.PersistentFlags().String(ConfigFlag, "", 23 "Specify the registry configuration to use for connection") 24 cvesCmd.PersistentFlags().StringP(UserFlag, "u", "", 25 `User Credentials of zot server in "username:password" format`) 26 cvesCmd.PersistentFlags().StringP(OutputFormatFlag, "f", "", "Specify output format [text/json/yaml]") 27 cvesCmd.PersistentFlags().Bool(VerboseFlag, false, "Show verbose output") 28 cvesCmd.PersistentFlags().Bool(DebugFlag, false, "Show debug output") 29 30 cvesCmd.AddCommand(NewCveForImageCommand(searchService)) 31 cvesCmd.AddCommand(NewImagesByCVEIDCommand(searchService)) 32 cvesCmd.AddCommand(NewFixedTagsCommand(searchService)) 33 cvesCmd.AddCommand(NewCVEDiffCommand(searchService)) 34 35 return cvesCmd 36 }