From 7cd24c061d0a0685d3d3bcc26231586ba2ed4380 Mon Sep 17 00:00:00 2001 From: Fabian Holler Date: Thu, 30 Nov 2023 14:48:16 +0100 Subject: [PATCH] cli: add --version parameter The version variable will be set by goreleaser on build. --- internal/cmd/root.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 3ae3e4c..3efa290 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -6,12 +6,16 @@ import ( "github.com/spf13/cobra" ) +// version is set via goreleaser +var version = "UNDEFINED" + func newRoot() *cobra.Command { const shortDesc = "Visualize Dependencies and generate deployment orders" root := &cobra.Command{ Short: shortDesc, SilenceUsage: true, + Version: version, } root.AddCommand(newDeployOrder().Command)