diff options
-rw-r--r-- | main.go | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -329,11 +329,13 @@ func main() { break } } - // Present the text, id and author of the prayer - fmt.Println(prayer.Text) - fmt.Println("ID:", prayer.Id) - fmt.Println("Author:", prayer.Author()) for code == "" { + // Clear the screen + fmt.Print("\033[H\033[2J") + // Present the text, id and author of the prayer + fmt.Println(prayer.Text) + fmt.Println("ID:", prayer.Id) + fmt.Println("Author:", prayer.Author()) // Ask for a keyword fmt.Print("Input a keyword for this prayer, skip to pick another one or code to enter the code manually: ") keyword := prompt.MustRead[string]() @@ -376,6 +378,12 @@ func main() { if answer == "skip" { break } + // If the answer is not y or skip, clear the screen + fmt.Print("\033[H\033[2J") + // Present the text, id and author of the prayer again + fmt.Println(prayer.Text) + fmt.Println("ID:", prayer.Id) + fmt.Println("Author:", prayer.Author()) } } if code != "" { |