-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
57 lines (49 loc) · 1.64 KB
/
main.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main
import (
"fmt"
"os"
"github.com/emmahsax/go-git-helper/cmd/changeRemote"
"github.com/emmahsax/go-git-helper/cmd/checkoutDefault"
"github.com/emmahsax/go-git-helper/cmd/cleanBranches"
"github.com/emmahsax/go-git-helper/cmd/codeRequest"
"github.com/emmahsax/go-git-helper/cmd/emptyCommit"
"github.com/emmahsax/go-git-helper/cmd/forgetLocalChanges"
"github.com/emmahsax/go-git-helper/cmd/forgetLocalCommits"
"github.com/emmahsax/go-git-helper/cmd/newBranch"
"github.com/emmahsax/go-git-helper/cmd/setHeadRef"
"github.com/emmahsax/go-git-helper/cmd/setup"
"github.com/emmahsax/go-git-helper/cmd/update"
"github.com/emmahsax/go-git-helper/cmd/version"
"github.com/spf13/cobra"
)
var (
packageOwner = "emmahsax"
packageRepository = "go-git-helper"
packageVersion = "0.0.11"
)
func main() {
rootCmd := newCommand()
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func newCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "git-helper",
Short: "Making it easier to work with git on the command-line",
}
cmd.AddCommand(changeRemote.NewCommand())
cmd.AddCommand(checkoutDefault.NewCommand())
cmd.AddCommand(cleanBranches.NewCommand())
cmd.AddCommand(codeRequest.NewCommand())
cmd.AddCommand(emptyCommit.NewCommand())
cmd.AddCommand(forgetLocalChanges.NewCommand())
cmd.AddCommand(forgetLocalCommits.NewCommand())
cmd.AddCommand(newBranch.NewCommand())
cmd.AddCommand(setHeadRef.NewCommand())
cmd.AddCommand(setup.NewCommand(packageOwner, packageRepository))
cmd.AddCommand(update.NewCommand(packageOwner, packageRepository))
cmd.AddCommand(version.NewCommand(packageVersion))
return cmd
}