-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.go
42 lines (37 loc) · 862 Bytes
/
info.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
package gitcmd
import (
"github.com/gookit/gcli/v3"
"github.com/gookit/gcli/v3/show"
"github.com/gookit/gitw"
"github.com/inhere/kite-go/internal/biz/cmdbiz"
)
var riOpts = struct {
cmdbiz.CommonOpts
}{}
// RepoInfoCmd instance
var RepoInfoCmd = &gcli.Command{
Name: "info",
// Aliases: []string{"ls"},
Desc: "show some info for the git repository",
Config: func(c *gcli.Command) {
riOpts.BindCommonFlags(c)
},
Func: func(c *gcli.Command, args []string) error {
rp := gitw.NewRepo(riOpts.Workdir)
show.AList("Information", rp.Info())
return nil
},
}
// RemoteInfoCmd instance
var RemoteInfoCmd = &gcli.Command{
Name: "remote",
Aliases: []string{"rmt"},
Desc: "git remote command",
Func: func(c *gcli.Command, args []string) error {
err := gitw.New("remote", "-v").Run()
if err != nil {
return err
}
return nil
},
}