From 1be06a532a02192e4241349e775c319af5077b6f Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Thu, 3 Feb 2022 11:14:22 +0100 Subject: [PATCH] Add ':' before version This makes it easier for crc to parse the version number. --- cmd/vfkit/root.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/vfkit/root.go b/cmd/vfkit/root.go index f3bfacb6..06d14570 100644 --- a/cmd/vfkit/root.go +++ b/cmd/vfkit/root.go @@ -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() {