Change 'minikube version --short' to only print the version without a prompt.

pull/11167/head
Andriy Dzikh 2021-04-21 15:25:59 -07:00
parent 24a759fb51
commit 810f7ab108
1 changed files with 7 additions and 3 deletions

View File

@ -45,9 +45,13 @@ var versionCmd = &cobra.Command{
} }
switch versionOutput { switch versionOutput {
case "": case "":
out.Ln("minikube version: %v", minikubeVersion) if !shortVersion {
if !shortVersion && gitCommitID != "" { out.Ln("minikube version: %v", minikubeVersion)
out.Ln("commit: %v", gitCommitID) if gitCommitID != "" {
out.Ln("commit: %v", gitCommitID)
}
} else {
out.Ln("%v", minikubeVersion)
} }
case "json": case "json":
json, err := json.Marshal(data) json, err := json.Marshal(data)