From 0ed28f07c959f865aa9394b9acab840d5ac0a2fe Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Fri, 29 Dec 2023 11:03:43 -0500 Subject: [PATCH] Add version flag to CLI --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 2908389..e30c28b 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ package main import ( "embed" + "flag" + "fmt" "github.com/labstack/gommon/log" "github.com/wailsapp/wails/v2" @@ -15,6 +17,13 @@ var assets embed.FS func main() { + showVersion := flag.Bool("version", false, "display version information") + flag.Parse() + if *showVersion { + fmt.Println("v0.1.0-alpha") + return + } + // Create an instance of the app structure app := NewApp()