From abff7cdad2e8f0894d621279486197710b951b92 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 14 Jul 2021 10:57:15 -0400 Subject: [PATCH] Refresh is an int now, and can set a timer for refreshing --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index d7efb55..4ef7de0 100644 --- a/main.go +++ b/main.go @@ -46,13 +46,13 @@ var ( window *widgets.QMainWindow mainApp *widgets.QApplication vehicleSearch string - refresh bool + refresh int popup = false ) func init() { flag.StringVar(&vehicleSearch, "v", "", "Vehicle Identifier") - flag.BoolVar(&refresh, "r", false, "Auto-refresh (every minute)") + flag.IntVar(&refresh, "r", -1, "Auto-refresh (every \"r\" minutes)") flag.Parse() } func main() { @@ -118,9 +118,9 @@ func main() { // Set Values for everything setValues() - if refresh { + if refresh >= 1{ go func() { - time.Sleep(1 * time.Minute) + time.Sleep(time.Duration(refresh) * time.Minute) setValues() }() }