-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
50 lines (46 loc) · 1.02 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
package main
import (
"log"
"os"
"github.com/ahodieb/git-helpers/cmd"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
Name: cmd.AppName,
Usage: "provides some additional functionality to git",
Flags: []cli.Flag{
&cli.StringFlag{
Name: cmd.FlagWorkingDir,
Aliases: []string{"C"},
Usage: "set working directory to `PATH`",
DefaultText: ".",
},
},
Commands: []*cli.Command{
{
Name: "checkout-main",
Usage: "checkout `main` branch, it checks out the main branch by looking for `main` or `master`",
Action: cmd.CheckoutMain,
},
{
Name: "rebase-all",
Usage: "rebase multiple branches onto `BRANCH`",
Action: cmd.RebaseAll,
},
{
Name: "install-git-aliases",
Usage: "sets up git aliases for all helper subcommands",
Action: cmd.InstallAliases,
},
{
Name: "version",
Usage: "shows the version of the cli",
Action: cmd.Version,
},
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}