From 109eab15680c02de621482e9200d1373fc16fd6b Mon Sep 17 00:00:00 2001 From: Adrian Hesketh Date: Thu, 24 Sep 2020 21:20:22 +0100 Subject: [PATCH] Added version number to the arguments. --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index d31a6db..037117f 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,8 @@ import ( "golang.org/x/text/transform" ) +var version string + type ClientCertPrefix string func (cc ClientCertPrefix) fileName() string { @@ -149,6 +151,11 @@ var defaultStyle = tcell.StyleDefault. Background(tcell.ColorBlack) func main() { + if strings.TrimLeft(os.Args[1], "-") == "version" { + fmt.Println(version) + return + } + // Configure the context to handle SIGINT. ctx, cancel := context.WithCancel(context.Background()) c := make(chan os.Signal)