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 {
case "":
out.Ln("minikube version: %v", minikubeVersion)
if !shortVersion && gitCommitID != "" {
out.Ln("commit: %v", gitCommitID)
if !shortVersion {
out.Ln("minikube version: %v", minikubeVersion)
if gitCommitID != "" {
out.Ln("commit: %v", gitCommitID)
}
} else {
out.Ln("%v", minikubeVersion)
}
case "json":
json, err := json.Marshal(data)