-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgituser.go
66 lines (57 loc) · 1.72 KB
/
gituser.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
66
package main
import (
"github.com/WindomZ/gituser/gituser"
"github.com/WindomZ/go-commander"
)
func main() {
// gituser
commander.Program.
Version("v1.2.2")
// gituser add [options] <user> <name> <email>
commander.Program.
Command("add <user> <name> <email>").
Description("add user configuration").
Option("--private-github", "private email address for GitHub").
Option("--debug", "debug mode, similar to sandbox mode").
Action(gituser.AddAction)
// gituser remove <user>
commander.Program.
Command("remove <user>").
Aliases([]string{"rm"}).
Description("remove user configuration").
Option("--debug", "debug mode, similar to sandbox mode").
Action(gituser.RemoveAction)
// gituser list
commander.Program.
Command("list").
Aliases([]string{"ls"}).
Description("list user configuration").
Option("--debug", "debug mode, similar to sandbox mode").
Action(gituser.ListAction)
// gituser set [options] <user>
commander.Program.
Command("set <user>").
Description("set local git user configuration from <user>").
Option("--private-github", "private email address for GitHub").
Option("--debug", "debug mode, similar to sandbox mode").
Action(gituser.SetAction)
// gituser unset [options]
commander.Program.
Command("unset").
Description("unset local git user configuration").
Action(gituser.UnsetAction)
commander.Program.Annotation(
"Argument",
[]string{
commander.Format.Description("<user>",
"the name of the configure user information"),
commander.Format.Description("<name>",
"the name of the git username"),
commander.Format.Description("<email>",
"the address of the git email"),
},
)
if _, err := commander.Program.Parse(); err != nil {
panic(err)
}
}