ship: v0.1 Foundation milestone complete (#1)
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Print version information",
|
||||
Long: "Print the orca version, git commit, and build time.",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
info := map[string]string{
|
||||
"version": version,
|
||||
"git_commit": gitCommit,
|
||||
"build_time": buildTime,
|
||||
}
|
||||
if jsonOutput {
|
||||
return printJSON(info)
|
||||
}
|
||||
printText("orca version %s\n", version)
|
||||
printText(" git commit: %s\n", gitCommit)
|
||||
printText(" build time: %s\n", buildTime)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user