Skip to content

Commit

Permalink
Add ':' before version
Browse files Browse the repository at this point in the history
This makes it easier for crc to parse the version number.
  • Loading branch information
cfergeau committed Feb 3, 2022
1 parent 30c7c35 commit 1be06a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/vfkit/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func init() {
rootCmd.Flags().UintVarP(&opts.memoryMiB, "memory", "m", 512, "virtual machine RAM size in mibibytes")

rootCmd.Flags().StringArrayVarP(&opts.devices, "device", "d", []string{}, "devices")

// this is almost the cobra default template with an added ':' before the version for crc's convenience
versionTmpl := `{{with .Name}}{{printf "%s " .}}{{end}}{{printf "version: %s" .Version}}
`
rootCmd.SetVersionTemplate(versionTmpl)
}

func Execute() {
Expand Down

0 comments on commit 1be06a5

Please sign in to comment.