mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +01:00
Extract line reading into util func
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
@@ -58,7 +57,7 @@ func (c *RecordCommand) Execute(args []string) error {
|
||||
util.Warningf("Current terminal size is %vx%v.", cols, rows)
|
||||
util.Warningf("It may be too big to be properly replayed on smaller screens.")
|
||||
util.Warningf("You can now resize it. Press <Enter> to start recording.")
|
||||
bufio.NewReader(os.Stdin).ReadString('\n')
|
||||
util.ReadLine()
|
||||
}
|
||||
|
||||
util.Printf("Asciicast recording started.")
|
||||
|
||||
11
util/readline.go
Normal file
11
util/readline.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"os"
|
||||
)
|
||||
|
||||
func ReadLine() string {
|
||||
s, _ := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user