MCPcopy Index your code
hub / github.com/git-bug/git-bug / runVersion

Function runVersion

commands/version.go:44–63  ·  view source on GitHub ↗
(env *execenv.Env, opts versionOptions, root *cobra.Command)

Source from the content-addressed store, hash-verified

42}
43
44func runVersion(env *execenv.Env, opts versionOptions, root *cobra.Command) {
45 if opts.all {
46 env.Out.Printf("%s version: %s\n", execenv.RootCommandName, root.Version)
47 env.Out.Printf("System version: %s/%s\n", runtime.GOARCH, runtime.GOOS)
48 env.Out.Printf("Golang version: %s\n", runtime.Version())
49 return
50 }
51
52 if opts.number {
53 env.Out.Println(root.Version)
54 return
55 }
56
57 if opts.commit {
58 env.Out.Println(GitCommit)
59 return
60 }
61
62 env.Out.Printf("%s version: %s\n", execenv.RootCommandName, root.Version)
63}

Callers 1

newVersionCommandFunction · 0.85

Calls 2

PrintfMethod · 0.65
PrintlnMethod · 0.65

Tested by

no test coverage detected