support quoted values in interactive commands

This commit is contained in:
Shlomi Noach 2018-02-25 19:17:37 +02:00
parent bf4b04f604
commit 9ae9cef17a

View File

@ -130,6 +130,9 @@ func (this *Server) applyServerCommand(command string, writer *bufio.Writer) (pr
arg := "" arg := ""
if len(tokens) > 1 { if len(tokens) > 1 {
arg = strings.TrimSpace(tokens[1]) arg = strings.TrimSpace(tokens[1])
if unquoted, err := strconv.Unquote(arg); err == nil {
arg = unquoted
}
} }
argIsQuestion := (arg == "?") argIsQuestion := (arg == "?")
throttleHint := "# Note: you may only throttle for as long as your binary logs are not purged\n" throttleHint := "# Note: you may only throttle for as long as your binary logs are not purged\n"