mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-16 20:57:53 +08:00
handle completions subcommand first (#116)
* handle completions subcommand first * raise errors from comp_matches Co-authored-by: Clément DOUIN <soywod@users.noreply.github.com> Co-authored-by: Clément DOUIN <soywod@users.noreply.github.com>
This commit is contained in:
+4
-1
@@ -67,6 +67,10 @@ fn run() -> Result<()> {
|
||||
debug!("[main] log level: {}", log_level);
|
||||
debug!("[main] custom config path: {:?}", custom_config);
|
||||
|
||||
if comp_matches(build_app(), &matches)? {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
debug!("[main] init config");
|
||||
let config = Config::new(custom_config)?;
|
||||
trace!("[main] {:#?}", config);
|
||||
@@ -83,7 +87,6 @@ fn run() -> Result<()> {
|
||||
let _matched = mbox_matches(&account, &matches)?
|
||||
|| flag_matches(&account, &mbox, &matches)?
|
||||
|| imap_matches(&config, &account, &mbox, &matches)?
|
||||
|| comp_matches(build_app(), &matches)?
|
||||
|| msg_matches(&config, &account, &mbox, &matches)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user