Refactored command parsing tokenization.

pull/4768/head
Paulo Pires 2015-11-12 20:52:41 +00:00
parent 194b2c4965
commit c812aaa36b
1 changed files with 1 additions and 8 deletions

View File

@ -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] {