From b90cbb2b6c8322d26ec2b71a5e9bdea74f75abcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Thu, 10 Oct 2024 21:23:23 +0200 Subject: [PATCH] Added version --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 3dd5f50..6882ead 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,10 @@ import ( "time" ) +const VERSION = "v1" + var ( + version bool fromHour int toHour int startDir string @@ -28,6 +31,7 @@ func parseCommandLine() { if err != nil { panic(err) } + flag.BoolVar(&version, "version", false, "Display version and exit") flag.IntVar(&fromHour, "from", 0, "Hour each day to start picking images from") flag.IntVar(&toHour, "to", 24, "Hour each day to start picking images up to") flag.StringVar(&startDir, "dir", workDir, "Directory to find date folders in") @@ -179,6 +183,11 @@ func concatVideos(unsortedDates []string) { // {{{ func main() { parseCommandLine() + if version { + fmt.Println(VERSION) + return + } + files := findFiles(startDir) slices.SortStableFunc(files, sortFiles) sortedDays := separateDays(files)