From d539c298431e4b1c8d852c567fa17b89014b018f Mon Sep 17 00:00:00 2001 From: miampf Date: Fri, 19 Jan 2024 15:56:02 +0000 Subject: [PATCH] fix: print error of query (#20) --- src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d914555..39fa201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,14 @@ fn main() -> Result<(), Box> { let args = cli::Cli::new_and_parse(); let file_index = get_tags_from_files(args.path.as_str())?; - let query = QueryParser::parse(Rule::tagsearch, args.query.as_str())?; + let query = QueryParser::parse(Rule::tagsearch, args.query.as_str()); + + if let Err(e) = query { + println!("Error: {}", e); + std::process::exit(1); + } + + let query = query.unwrap(); for file in file_index.iter() { let ast = construct_query_ast(