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

Function newVersionCommand

commands/version.go:17–42  ·  view source on GitHub ↗
(env *execenv.Env)

Source from the content-addressed store, hash-verified

15}
16
17func newVersionCommand(env *execenv.Env) *cobra.Command {
18 options := versionOptions{}
19
20 cmd := &cobra.Command{
21 Use: "version",
22 Short: "Show git-bug version information",
23 Run: func(cmd *cobra.Command, args []string) {
24 runVersion(env, options, cmd.Root())
25 },
26 }
27
28 flags := cmd.Flags()
29 flags.SortFlags = false
30
31 flags.BoolVarP(&options.number, "number", "n", false,
32 "Only show the version number",
33 )
34 flags.BoolVarP(&options.commit, "commit", "c", false,
35 "Only show the commit hash",
36 )
37 flags.BoolVarP(&options.all, "all", "a", false,
38 "Show all version information",
39 )
40
41 return cmd
42}
43
44func runVersion(env *execenv.Env, opts versionOptions, root *cobra.Command) {
45 if opts.all {

Callers 1

NewRootCommandFunction · 0.85

Calls 1

runVersionFunction · 0.85

Tested by

no test coverage detected