mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 08:49:37 +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)
|
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
|
// Command - choose one
|
||||||
func Command(commands []string) byte {
|
func Command(commands []string) byte {
|
||||||
opts := []string{}
|
opts := []string{}
|
||||||
|
Loading…
Reference in New Issue
Block a user