diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-12-24 23:31:04 -0800 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-12-24 23:31:04 -0800 |
commit | 08783c91b6f9cee2c2586891da7ed3ceed5d3cb5 (patch) | |
tree | e5715b3166aff24d07719b2fe8acf286f2e1508f /src/tw/mod.rs | |
parent | 4da61b2df85741860e65416a7dd5e06bef688fd3 (diff) |
fix bug where no-param commands would only be accepted with an empty line following
Diffstat (limited to 'src/tw/mod.rs')
-rw-r--r-- | src/tw/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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) { |