Skip to content

Commit

Permalink
Remove extra output lines after the version
Browse files Browse the repository at this point in the history
Some commands, like crio and runc, dump extra line noise
after the --version even though they have a long version.
  • Loading branch information
afbjorklund committed Aug 1, 2021
1 parent 46c3797 commit 4f6ee47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/minikube/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ var versionCmd = &cobra.Command{
klog.Warningf("error getting %s's version: %v", k, err)
data[k] = "error"
} else {
data[k] = strings.TrimSpace(rr.Stdout.String())
version := rr.Stdout.String()
// remove extra lines after the version
version = strings.Split(version, "\n")[0]
data[k] = strings.TrimSpace(version)
}

}
Expand Down

0 comments on commit 4f6ee47

Please sign in to comment.