From c812aaa36b06fb0a32c63845fa8a7ce0159c6ae8 Mon Sep 17 00:00:00 2001 From: Paulo Pires Date: Thu, 12 Nov 2015 20:52:41 +0000 Subject: [PATCH] Refactored command parsing tokenization. --- cmd/influx/cli/cli.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cmd/influx/cli/cli.go b/cmd/influx/cli/cli.go index 67acd9c34b..18250a587d 100644 --- a/cmd/influx/cli/cli.go +++ b/cmd/influx/cli/cli.go @@ -190,14 +190,7 @@ Loop: // ParseCommand parses an instruction and calls related method, if any func (c *CommandLine) ParseCommand(cmd string) bool { lcmd := strings.TrimSpace(strings.ToLower(cmd)) - - split := strings.Split(lcmd, " ") - var tokens []string - for _, token := range split { - if token != "" { - tokens = append(tokens, token) - } - } + tokens := strings.Fields(lcmd) if len(tokens) > 0 { switch tokens[0] {