-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
65 lines (61 loc) · 1.36 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
58
59
60
61
62
63
64
65
package main
import (
"log"
"os"
"github.com/urfave/cli/v2"
"github.com/yasukotelin/git-ex/cmd"
)
func main() {
app := &cli.App{
Name: "git-ex",
Usage: "git-ex is a subcommand that extends Git",
Version: "0.6.0",
Commands: []*cli.Command{
&cli.Command{
Name: "discard",
Usage: "Executes the removing all changes from the HEAD that include untracked files",
Action: cmd.Discard,
},
&cli.Command{
Name: "stage",
Usage: "Executes the staging files with selecter.",
Action: cmd.Stage,
},
&cli.Command{
Name: "unstage",
Usage: "Executes the unstaging files with selecter.",
Action: cmd.UnStage,
},
&cli.Command{
Name: "diff",
Usage: "Executes the diff with selecter.",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "stage",
Value: false,
Usage: "true is showing stage files, false is showing unstaging files",
},
},
Action: cmd.Diff,
},
&cli.Command{
Name: "branch",
Usage: "Checkout a branch with selecter",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "all",
Aliases: []string{"a"},
Value: false,
Usage: "true is showing local and remote branchs, false is local only",
},
},
Action: cmd.Branch,
},
},
Action: cli.ShowAppHelp,
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}