From 0e50c8ec046f9b6305cc695aa287aa7157bb847e Mon Sep 17 00:00:00 2001 From: asrul10 Date: Sun, 9 Apr 2023 10:25:50 +0700 Subject: [PATCH] feat: remove borders to make it easy to copy --- README.md | 6 +++--- go.mod | 5 ----- go.sum | 4 ---- main.go | 11 ++--------- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 4c87952..dc7eaaa 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ Or you can [download lcg executable file](https://github.com/asrul10/linux-comma ```bash > lcg I want to extract linux-command-gpt.tar.gz file Completed in 0.92 seconds -┌────────────────────────────────────┐ -│ tar -xvzf linux-command-gpt.tar.gz │ -└────────────────────────────────────┘ + +tar -xvzf linux-command-gpt.tar.gz + Are you sure you want to execute the command? (Y/n): ``` diff --git a/go.mod b/go.mod index f91e102..34864fe 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,3 @@ module github.com/asrul/linux-command-gpt go 1.18 - -require ( - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect -) diff --git a/go.sum b/go.sum index 275ee62..e69de29 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +0,0 @@ -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= diff --git a/main.go b/main.go index 1e4f0ce..9331354 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,6 @@ import ( "time" "github.com/asrul/linux-command-gpt/gpt" - "golang.org/x/term" ) const ( @@ -59,10 +58,6 @@ func handleCommand(cmd string) int { } func main() { - width, _, err := term.GetSize(0) - if err != nil { - panic(err) - } currentUser, err := user.Current() if err != nil { panic(err) @@ -131,11 +126,9 @@ func main() { c := "Y" elapsed := time.Since(s).Seconds() elapsed = math.Round(elapsed*100) / 100 - fmt.Printf("Completed in %v seconds\n", elapsed) - fmt.Println(strings.Repeat("─", width)) + fmt.Printf("Completed in %v seconds\n\n", elapsed) fmt.Println(r) - fmt.Println(strings.Repeat("─", width)) - fmt.Print("Are you sure you want to execute the command? (Y/n): ") + fmt.Print("\nAre you sure you want to execute the command? (Y/n): ") fmt.Scanln(&c) if c != "Y" && c != "y" { return