MCPcopy Create free account
hub / github.com/jetify-com/devbox / versionCmdFunc

Function versionCmdFunc

internal/boxcli/version.go:54–69  ·  view source on GitHub ↗
(cmd *cobra.Command, _ []string, flags versionFlags)

Source from the content-addressed store, hash-verified

52}
53
54func versionCmdFunc(cmd *cobra.Command, _ []string, flags versionFlags) error {
55 w := cmd.OutOrStdout()
56 info := getVersionInfo()
57 if flags.verbose {
58 fmt.Fprintf(w, "Version: %v\n", info.Version)
59 fmt.Fprintf(w, "Platform: %v\n", info.Platform)
60 fmt.Fprintf(w, "Commit: %v\n", info.Commit)
61 fmt.Fprintf(w, "Commit Time: %v\n", info.CommitDate)
62 fmt.Fprintf(w, "Go Version: %v\n", info.GoVersion)
63 fmt.Fprintf(w, "Launcher: %v\n", info.LauncherVersion)
64
65 } else {
66 fmt.Fprintf(w, "%v\n", info.Version)
67 }
68 return nil
69}
70
71type versionInfo struct {
72 Version string

Callers 1

versionCmdFunction · 0.85

Calls 1

getVersionInfoFunction · 0.85

Tested by

no test coverage detected