(env *execenv.Env, opts versionOptions, root *cobra.Command)
| 42 | } |
| 43 | |
| 44 | func 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 | } |
no test coverage detected