From 7b8a17764e9c63a5e4e565e7fa288dd7ccbd24eb Mon Sep 17 00:00:00 2001 From: qowevisa Date: Thu, 14 Mar 2024 00:06:20 +0200 Subject: [PATCH] Add ctui binary --- Makefile | 3 +++ cmd/ctui/main.go | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 cmd/ctui/main.go diff --git a/Makefile b/Makefile index 38135eb..fdcb211 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,9 @@ client: testinp: go build -o ./bin/$@ ./cmd/$@ +ctui: + go build -o ./bin/$@ ./cmd/$@ + gen_test_certs: openssl ecparam -genkey -name prime256v1 -out server.key openssl req -new -x509 -key server.key -out server.pem -days 3650 diff --git a/cmd/ctui/main.go b/cmd/ctui/main.go new file mode 100644 index 0000000..c46ed74 --- /dev/null +++ b/cmd/ctui/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "log" + "os" + + "git.qowevisa.me/Qowevisa/gotell/tui" +) + +func main() { + logFile, err := os.OpenFile("ctui.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + if err != nil { + panic(err) + } + defer logFile.Close() + log.SetOutput(logFile) + log.Printf("Start") + + err = tui.UI.Run() + if err != nil { + panic(err) + } +}