2023-09-08 07:12:47 -05:00
|
|
|
//go:build search
|
|
|
|
// +build search
|
|
|
|
|
2023-09-15 17:17:01 -05:00
|
|
|
package client
|
2023-09-08 07:12:47 -05: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 12:51:17 -05:00
|
|
|
RunE: ShowSuggestionsIfUnknownCommand,
|
2023-09-08 07:12:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
repoCmd.SetUsageTemplate(repoCmd.UsageTemplate() + usageFooter)
|
|
|
|
|
2023-09-22 08:33:18 -05:00
|
|
|
repoCmd.PersistentFlags().String(URLFlag, "",
|
2023-09-08 07:12:47 -05:00
|
|
|
"Specify zot server URL if config-name is not mentioned")
|
2023-09-22 08:33:18 -05:00
|
|
|
repoCmd.PersistentFlags().String(ConfigFlag, "",
|
2023-09-08 07:12:47 -05:00
|
|
|
"Specify the registry configuration to use for connection")
|
2023-09-22 08:33:18 -05:00
|
|
|
repoCmd.PersistentFlags().StringP(UserFlag, "u", "",
|
2023-09-08 07:12:47 -05:00
|
|
|
`User Credentials of zot server in "username:password" format`)
|
2023-09-22 08:33:18 -05:00
|
|
|
repoCmd.PersistentFlags().Bool(DebugFlag, false, "Show debug output")
|
2023-09-08 07:12:47 -05:00
|
|
|
|
|
|
|
repoCmd.AddCommand(NewListReposCommand(searchService))
|
|
|
|
|
|
|
|
return repoCmd
|
|
|
|
}
|