Comments
Patch
@@ -12,6 +12,12 @@
Unimplemented command
$ rhg unimplemented-command
+ error: Found argument 'unimplemented-command' which wasn't expected, or isn't valid in this context
+
+ USAGE:
+ rhg <SUBCOMMAND>
+
+ For more information try --help
[252]
Finding root
@@ -47,6 +47,12 @@
stderr.flush().or_else(handle_stderr_error)
}
+
+ /// Write string line to stderr
+ pub fn writeln_stderr_str(&self, s: &str) -> Result<(), UiError> {
+ eprintln!("{}", s);
+ Ok(())
+ }
}
/// A buffered stdout writer for faster batch printing operations.
@@ -21,7 +21,8 @@
SubCommand::with_name("files").about(commands::files::HELP_TEXT),
);
- let matches = app.clone().get_matches_safe().unwrap_or_else(|_| {
+ let matches = app.clone().get_matches_safe().unwrap_or_else(|err| {
+ let _ = ui::Ui::new().writeln_stderr_str(&err.message);
std::process::exit(exitcode::UNIMPLEMENTED_COMMAND)
});