MCPcopy
hub / github.com/go-git/go-git / main

Function main

cli/go-git/main.go:16–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14)
15
16func main() {
17 switch filepath.Base(os.Args[0]) {
18 case receivePackBin:
19 os.Args = append([]string{"git", "receive-pack"}, os.Args[1:]...)
20 case uploadPackBin:
21 os.Args = append([]string{"git", "upload-pack"}, os.Args[1:]...)
22 }
23
24 parser := flags.NewNamedParser(bin, flags.Default)
25 parser.AddCommand("update-server-info", "", "", &CmdUpdateServerInfo{})
26 parser.AddCommand("receive-pack", "", "", &CmdReceivePack{})
27 parser.AddCommand("upload-pack", "", "", &CmdUploadPack{})
28 parser.AddCommand("version", "Show the version information.", "", &CmdVersion{})
29
30 _, err := parser.Parse()
31 if err != nil {
32 if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrCommandRequired {
33 parser.WriteHelp(os.Stdout)
34 }
35
36 os.Exit(1)
37 }
38}
39
40type cmd struct {
41 Verbose bool `short:"v" description:"Activates the verbose mode"`

Callers

nothing calls this directly

Calls 1

ParseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…