-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitinit.go
More file actions
37 lines (31 loc) · 850 Bytes
/
gitinit.go
File metadata and controls
37 lines (31 loc) · 850 Bytes
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
package main
import (
"github.com/WindomZ/gitinit/gitinit"
"github.com/WindomZ/go-commander"
)
func main() {
// gitinit
commander.Program.
Version("0.0.1").
Description("A cli tool, easy way to 'git init' a new repository.").
Action(gitinit.GitInitAction)
// gitinit --init
commander.Program.
Command("-i --init").
Description("create an empty Git repository or reinitialize an existing one").
Action(gitinit.FlagInitAction).
Option("--origin=REPO")
// gitinit --bare
commander.Program.
Command("-b --bare").
Description("create a bare repository").
Action(gitinit.FlagBareAction)
// gitinit --origin=REPO
commander.Program.
Command("--origin=REPO").
Description("reset 'origin' repository to 'REPO'").
Action(gitinit.FlagOriginAction)
if _, err := commander.Program.Parse(); err != nil {
panic(err)
}
}