mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
config: add ReadNonEmptyLine utility function
This commit is contained in:
parent
74f6300875
commit
262ba28dec
@ -624,6 +624,16 @@ var ReadLine = func() string {
|
||||
return strings.TrimSpace(line)
|
||||
}
|
||||
|
||||
// ReadNonEmptyLine prints prompt and calls Readline until non empty
|
||||
func ReadNonEmptyLine(prompt string) string {
|
||||
result := ""
|
||||
for result == "" {
|
||||
fmt.Print(prompt)
|
||||
result = strings.TrimSpace(ReadLine())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// Command - choose one
|
||||
func Command(commands []string) byte {
|
||||
opts := []string{}
|
||||
|
Loading…
Reference in New Issue
Block a user