Added functionalities to show input from pipe and if repeat mode is on

pull/2/head
Aaron Johnon 1 year ago
parent 57cbc99379
commit c7ba043dec

@ -43,6 +43,10 @@ func main() {
var input string var input string
if *repeat {
fmt.Println("Repeat mode is ON")
}
// Check if input is being redirected from a file // Check if input is being redirected from a file
if isInputFromPipe() { if isInputFromPipe() {
// Read from stdin (file input) // Read from stdin (file input)
@ -57,6 +61,10 @@ func main() {
return return
} }
input = inputBuilder.String() input = inputBuilder.String()
// Display the input, filtered to uppercase, before playback
fmt.Println("Input:\n")
fmt.Println(strings.ToUpper(input))
} else { } else {
// Use readline for interactive input // Use readline for interactive input
rl, err := readline.NewEx(&readline.Config{ rl, err := readline.NewEx(&readline.Config{
@ -104,7 +112,7 @@ func main() {
return r == ' ' || r == '-' || r == '_' || r == '\n' || r == '\r' return r == ' ' || r == '-' || r == '_' || r == '\n' || r == '\r'
}) })
fmt.Println("Beginning playback...") fmt.Print("Beginning playback... ")
for _, section := range sections { for _, section := range sections {
numRepeats := 1 numRepeats := 1

Loading…
Cancel
Save