From e280a9f8b5e13a92f3db7faabbf075be726093da Mon Sep 17 00:00:00 2001 From: Zikani Nyirenda Mwase Date: Wed, 11 May 2022 20:49:52 +0200 Subject: [PATCH] Rename version flag This should make it more compatible with goreleaser build tags --- groupby.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/groupby.go b/groupby.go index b091cc9..1554f4e 100644 --- a/groupby.go +++ b/groupby.go @@ -11,7 +11,6 @@ import ( ) const ( - Version = "0.1.0" SubdirectoryInner = "├──" SubdirectoryPipe = "│" SubdirectoryLink = "└──" @@ -35,7 +34,8 @@ var ( excludePattern string filterPattern string = "" verbose bool - version bool + showVersion bool + version string = "0.0.0" ) func init() { @@ -60,7 +60,7 @@ func init() { // flag.BoolVar(&recurse, "R", "recurse" "Group files in subdirectories") flag.BoolVar(&verbose, "verbose", false, "\tShow verbose output") flag.BoolVar(&verbose, "v", false, "\tShow verbose output") - flag.BoolVar(&version, "version", false, "\tShow the program version and exit") + flag.BoolVar(&showVersion, "version", false, "\tShow the program version and exit") } // MonthAsName returns the full month name for the provided monthStr @@ -159,8 +159,8 @@ func GetFileInfoYMD(fileInfo os.FileInfo) (int, time.Month, int) { func main() { flag.Parse() - if version { - fmt.Println("groupby ", Version, " - Group files and directories by the date they were created or modified") + if showVersion { + fmt.Println("groupby ", version, " - Group files and directories by the date they were created or modified") fmt.Println("By Zikani Nyirenda Mwase ") os.Exit(0) }