Minor error handling fixed
[evpf.git] / src / main.rs
index c5dd52e..51ea94e 100644 (file)
@@ -254,14 +254,16 @@ fn run_interactive_mode (match_num : &regex::Regex) {
                if rl.save_history (&hist_file.unwrap()).is_err () {
                        eprintln! ("{}", SAVE_HISTORY_ERROR);
                }
-       } 
+       } else {
+               eprintln! ("{}", &hist_file.unwrap_err());
+       }
 }
 
 fn main() {
        // collect the command line arguments - if any 
        let args : Vec<String> = env::args().collect ();
        // regular expression to match a number 
-       let match_num = Regex::new (r"^\d+?\.*?\d*?$").unwrap ();
+       let match_num = Regex::new (r"^\-?\d+?\.*?\d*?$").unwrap ();
        
        if args.len () > 1 {
        // if arguments are provided run in command line mode - i.e. print the