-
Notifications
You must be signed in to change notification settings - Fork 51
/
repository.go
33 lines (31 loc) · 1.25 KB
/
repository.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package repository
import (
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/repository/add"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/repository/create"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/repository/deletecmd"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/repository/export"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/repository/resolve"
"github.com/jenkins-x/jx-helpers/v3/pkg/cobras"
"github.com/jenkins-x/jx-logging/v3/pkg/log"
"github.com/spf13/cobra"
)
// NewCmdRepository creates the new command
func NewCmdRepository() *cobra.Command {
command := &cobra.Command{
Use: "repository",
Short: "Commands for working with source repositories",
Aliases: []string{"repo", "repos", "repositories"},
Run: func(command *cobra.Command, args []string) {
err := command.Help()
if err != nil {
log.Logger().Errorf(err.Error())
}
},
}
command.AddCommand(cobras.SplitCommand(add.NewCmdAddRepository()))
command.AddCommand(cobras.SplitCommand(create.NewCmdCreateRepository()))
command.AddCommand(cobras.SplitCommand(deletecmd.NewCmdDeleteRepository()))
command.AddCommand(cobras.SplitCommand(export.NewCmdExportConfig()))
command.AddCommand(cobras.SplitCommand(resolve.NewCmdResolveRepository()))
return command
}