-
Notifications
You must be signed in to change notification settings - Fork 50
/
git.go
30 lines (28 loc) · 962 Bytes
/
git.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
package git
import (
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/git/clone"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/git/get"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/git/merge"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/git/setup"
"github.com/jenkins-x/jx-helpers/v3/pkg/cobras"
"github.com/jenkins-x/jx-logging/v3/pkg/log"
"github.com/spf13/cobra"
)
// NewCmdGit creates the new command
func NewCmdGit() *cobra.Command {
command := &cobra.Command{
Use: "git",
Short: "Commands for working with Git",
Run: func(command *cobra.Command, args []string) {
err := command.Help()
if err != nil {
log.Logger().Errorf(err.Error())
}
},
}
command.AddCommand(cobras.SplitCommand(clone.NewCmdGitClone()))
command.AddCommand(cobras.SplitCommand(get.NewCmdGitGet()))
command.AddCommand(cobras.SplitCommand(merge.NewCmdGitMerge()))
command.AddCommand(cobras.SplitCommand(setup.NewCmdGitSetup()))
return command
}