Try to load language for --do-you-understand
This commit is contained in:
parent
169380d8bc
commit
d62b1657c3
11
src/main.rs
11
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") {
|
||||
|
|
Loading…
Reference in New Issue
Block a user