0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-23 22:27:35 -05:00
zot/pkg/cli/repo_sub_cmd.go
LaurentiuNiculae 7b1e24c99e
refactor(cli): remove old cli commands (#1756)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
2023-09-08 15:12:47 +03:00

27 lines
514 B
Go

//go:build search
// +build search
package cli
import (
"github.com/spf13/cobra"
)
func NewListReposCommand(searchService SearchService) *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Short: "List all repositories",
Long: "List all repositories",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
searchConfig, err := GetSearchConfigFromFlags(cmd, searchService)
if err != nil {
return err
}
return SearchRepos(searchConfig)
},
}
return cmd
}