From d62b1657c3b50b8d33a1064518f05884325440a6 Mon Sep 17 00:00:00 2001 From: xenia Date: Sun, 12 Nov 2023 11:42:22 +0100 Subject: [PATCH] Try to load language for --do-you-understand --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 6f61c37..6fdec86 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,16 @@ fn main() { if let Some(filetype) = matches.value_of("do-you-understand") { let language = ffi::filetype_to_language(filetype); - std::process::exit(if language.is_some() { 0 } else { 1 }); + if let Some(language) = language { + eprintln!("Known language. Trying to load"); + let mut parser = Parser::new(); + parser.set_language(language).unwrap(); + eprintln!("Loaded successfully"); + std::process::exit(0); + } else { + eprintln!("Unknown language"); + std::process::exit(1); + } } let config = if let Some(config_path) = matches.value_of("config") {