summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-17 18:07:04 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-17 18:07:04 -0400
commite9ba4d33fb582f5a1ee556ba75319254d6bb51b6 (patch)
treeece7dc2c253d4a116d2f0b2e4518ef110396105e /src/main.rs
parenta0286692964d120ee8a6ea36fbfb2f577dc2305c (diff)
fix cut
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index d11aafd..5820b1f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,6 +13,7 @@ mod util;
use lazy_static::lazy_static;
use std::path::PathBuf;
+use std::process;
use structopt::StructOpt;
use config::{
@@ -68,7 +69,13 @@ fn main() {
return;
}
if let Some(p) = args.path {
- std::env::set_current_dir(p.as_path());
+ match std::env::set_current_dir(p.as_path()) {
+ Ok(_) => {},
+ Err(e) => {
+ eprintln!("{}", e);
+ process::exit(1);
+ }
+ }
}
let config = JoshutoConfig::get_config();
@@ -76,6 +83,9 @@ fn main() {
match run(config, keymap) {
Ok(_) => {}
- Err(e) => eprintln!("{}", e),
+ Err(e) => {
+ eprintln!("{}", e);
+ process::exit(1);
+ }
}
}