Skip to content

Commit

Permalink
Initial display.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentlouisetonino committed Mar 26, 2024
1 parent 03ec018 commit 78720aa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/displays/clear_screen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package displays

import (
"os"
"os/exec"
)

func ClearScreen() {
c := exec.Command("clear")
c.Stdout = os.Stdout
c.Run()
}
3 changes: 3 additions & 0 deletions src/displays/escape_sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ package displays

const Newline = "\n"
const Tab = "\t"
const ColorReset = "\033[0m"
const ColorBlue = "\033[34m"
const ColorGreen = "\033[32m"
9 changes: 5 additions & 4 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

func main() {
displays.ClearScreen()
displays.AddNewline()
fmt.Println(displays.Tab, "--------------------------------------------------")
fmt.Println("\t", displays.ColorBlue, "---------------------------------------------------------", displays.ColorReset)
displays.AddNewline()
fmt.Println(" TempScale ")
fmt.Println("\t\t\t\t", displays.ColorGreen, "TempScale", displays.ColorReset)
displays.AddNewline()
fmt.Println(displays.Tab, " A CLI tool for converting temperature scale. ")
fmt.Println("\t\t", "A CLI tool for converting temperature scale.")
displays.AddNewline()
fmt.Println(displays.Tab, "--------------------------------------------------")
fmt.Println("\t", displays.ColorBlue, "---------------------------------------------------------", displays.ColorReset)
displays.AddNewline()
}

0 comments on commit 78720aa

Please sign in to comment.