cli: Fix exit code of parse subcommand

This commit is contained in:
Max Brunsfeld 2019-02-06 16:17:35 -08:00
parent ccbb8c1cce
commit af694b4c13
2 changed files with 9 additions and 4 deletions

View file

@ -14,7 +14,7 @@ pub fn parse_file_at_path(
print_time: bool,
debug: bool,
debug_graph: bool,
) -> Result<()> {
) -> Result<bool> {
let mut _log_session = None;
let mut parser = Parser::new();
parser.set_language(language)?;
@ -126,7 +126,7 @@ pub fn parse_file_at_path(
let end = node.end_position();
write!(
&mut stdout,
"\t({} [{}, {}] - [{}, {}]",
"\t({} [{}, {}] - [{}, {}])",
node.kind(),
start.row,
start.column,
@ -137,5 +137,5 @@ pub fn parse_file_at_path(
write!(&mut stdout, "\n")?;
}
Ok(())
Ok(first_error.is_some())
}