Mercurial > public > mercurial-scm > hg-stable
diff rust/rhg/src/main.rs @ 45451:a6a000ab135b
rhg: print error message when argument parsing fails
Differential Revision: https://phab.mercurial-scm.org/D8956
author | Antoine Cezar <antoine.cezar@octobus.net> |
---|---|
date | Mon, 17 Aug 2020 16:55:43 +0200 |
parents | ed95ccc94333 |
children | f17caf8f3fef |
line wrap: on
line diff
--- a/rust/rhg/src/main.rs Thu Aug 13 16:36:42 2020 +0200 +++ b/rust/rhg/src/main.rs Mon Aug 17 16:55:43 2020 +0200 @@ -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) });