2023-09-08 15:12:47 +03:00
|
|
|
//go:build search
|
|
|
|
// +build search
|
|
|
|
|
2023-09-16 01:17:01 +03:00
|
|
|
package client
|
2023-09-08 15:12:47 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
const prefix = "Searching... "
|
|
|
|
|
|
|
|
func NewRepoCommand(searchService SearchService) *cobra.Command {
|
|
|
|
repoCmd := &cobra.Command{
|
|
|
|
Use: "repo [config-name]",
|
|
|
|
Short: "List all repositories",
|
|
|
|
Long: `List all repositories`,
|
2023-09-14 20:51:17 +03:00
|
|
|
RunE: ShowSuggestionsIfUnknownCommand,
|
2023-09-08 15:12:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
repoCmd.SetUsageTemplate(repoCmd.UsageTemplate() + usageFooter)
|
|
|
|
|
2023-09-22 16:33:18 +03:00
|
|
|
repoCmd.PersistentFlags().String(URLFlag, "",
|
2023-09-08 15:12:47 +03:00
|
|
|
"Specify zot server URL if config-name is not mentioned")
|
2023-09-22 16:33:18 +03:00
|
|
|
repoCmd.PersistentFlags().String(ConfigFlag, "",
|
2023-09-08 15:12:47 +03:00
|
|
|
"Specify the registry configuration to use for connection")
|
2023-09-22 16:33:18 +03:00
|
|
|
repoCmd.PersistentFlags().StringP(UserFlag, "u", "",
|
2023-09-08 15:12:47 +03:00
|
|
|
`User Credentials of zot server in "username:password" format`)
|
2023-09-22 16:33:18 +03:00
|
|
|
repoCmd.PersistentFlags().Bool(DebugFlag, false, "Show debug output")
|
2023-09-08 15:12:47 +03:00
|
|
|
|
|
|
|
repoCmd.AddCommand(NewListReposCommand(searchService))
|
|
|
|
|
|
|
|
return repoCmd
|
|
|
|
}
|