summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 401bbe4..5b35f4a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,5 +1,6 @@
use std::fs::File;
use std::io::BufReader;
+use std::path::Path;
extern crate clap;
use clap::{load_yaml, App};
@@ -13,7 +14,11 @@ fn main() {
let path = matches.value_of("FILE").unwrap();
- let file: File = File::open(path).unwrap();
- let data: ParserResult = parse(BufReader::new(file));
- dbg!(data.meeting_name);
+ match Path::new(path).exists() {
+ true => {
+ let file: File = File::open(path).unwrap();
+ let data: ParserResult = parse(BufReader::new(file));
+ }
+ _ => panic!("Error File!"),
+ };
}