update the main

This commit is contained in:
Tamo 2021-11-04 14:48:39 +01:00
parent d0fe9dea61
commit b1a0110a47
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69

View File

@ -1,11 +1,16 @@
fn main() {
let input = std::env::args().nth(1).expect("You must provide a filter to test");
println!("Trying to execute the following filter:\n{}\n\n", input);
println!("Trying to execute the following filter:\n{}\n", input);
if let Err(e) = filter_parser::FilterCondition::parse(&input) {
println!("{}", e.to_string());
} else {
match filter_parser::FilterCondition::parse(&input) {
Ok(filter) => {
println!("✅ Valid filter");
println!("{:#?}", filter);
}
Err(e) => {
println!("❎ Invalid filter");
println!("{}", e.to_string());
}
}
}