repl: do not treat empty string as command

Previously, just pressing "<Enter>" at prompt resulted in following error
message:

	Error: Unknown command: "" type ? for help.

This message is harmless, but useless.  Also, such behaviour is different from
many (if not all) interactive environments: python, bash, dash, ...

With this change empty input string is silently ignored.
This commit is contained in:
Dmitry Bogatov
2019-07-27 00:16:34 +00:00
parent f63e79cd6d
commit 7a07629d68

View File

@@ -1192,6 +1192,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
bail!("Command failed.");
}
}
"" => (),
_ => bail!("Unknown command: \"{}\" type ? for help.", arg0),
}