From a97fab4894f1a4c4c80cc41db67b60daa50c5f4a Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 24 Dec 2017 23:31:04 -0800 Subject: fix bug where no-param commands would only be accepted with an empty line following --- src/tw/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/tw/mod.rs b/src/tw/mod.rs index f9fda69..2eb574f 100644 --- a/src/tw/mod.rs +++ b/src/tw/mod.rs @@ -535,6 +535,8 @@ fn parse_word_command<'a, 'b>(line: &'b str, commands: &[&'a Command]) -> Option if cmd.params == 0 { if line == cmd.keyword { return Some(("", &cmd)); + } else if line.starts_with(&format!("{} ", cmd.keyword)) { + return Some((line.get((cmd.keyword.len() + 1)..).unwrap().trim(), &cmd)); } } else if line.starts_with(cmd.keyword) { if line.find(" ").map(|x| x == cmd.keyword.len()).unwrap_or(false) { -- cgit v1.1