From 32ee7a355c373eab89be342a637180547ae0ee7e Mon Sep 17 00:00:00 2001 From: k3y0708 Date: Tue, 9 May 2023 21:40:48 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20about=20and=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main.go b/src/main.go index 87253ea..084e566 100644 --- a/src/main.go +++ b/src/main.go @@ -16,6 +16,8 @@ const ( Prompt = "otter> " OtterHistory = ".otterhistory" OtterRC = ".otterrc" + NAME = "minify_tf" + VERSION = "v0.0.1" ) func executeCommand(cmd string, args []string) { @@ -36,6 +38,21 @@ func executeCommand(cmd string, args []string) { } sourceFile(args[0]) + case "about": + nv := NAME + " " + VERSION + nvLen := len(nv) + spacesLen := 26 - nvLen + for i := 0; i < spacesLen; i++ { + nv += " " + } + + fmt.Println("+----------------------------+") + fmt.Println("| " + nv + "|") + fmt.Println("| by @k3y0708 |") + fmt.Println("| https://github.com/k3y0708 |") + fmt.Println("+----------------------------+") + case "version": + fmt.Println(VERSION) default: //Check if command is a file cmd, err := findCommand(cmd)