|
|
@ -26,14 +26,22 @@ impl<'b> Controller<'b> {
|
|
|
|
let stdin = io::stdin();
|
|
|
|
let stdin = io::stdin();
|
|
|
|
|
|
|
|
|
|
|
|
for input_file in &self.config.files {
|
|
|
|
for input_file in &self.config.files {
|
|
|
|
let mut reader = input_file.get_reader(&stdin)?;
|
|
|
|
match input_file.get_reader(&stdin) {
|
|
|
|
|
|
|
|
Err(error) => {
|
|
|
|
|
|
|
|
handle_error(&error);
|
|
|
|
|
|
|
|
no_errors = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(mut reader) => {
|
|
|
|
let result = if self.config.loop_through {
|
|
|
|
let result = if self.config.loop_through {
|
|
|
|
let mut printer = SimplePrinter::new();
|
|
|
|
let mut printer = SimplePrinter::new();
|
|
|
|
self.print_file(reader, &mut printer, writer, *input_file)
|
|
|
|
self.print_file(reader, &mut printer, writer, *input_file)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let mut printer =
|
|
|
|
let mut printer = InteractivePrinter::new(
|
|
|
|
InteractivePrinter::new(&self.config, &self.assets, *input_file, &mut reader);
|
|
|
|
&self.config,
|
|
|
|
|
|
|
|
&self.assets,
|
|
|
|
|
|
|
|
*input_file,
|
|
|
|
|
|
|
|
&mut reader,
|
|
|
|
|
|
|
|
);
|
|
|
|
self.print_file(reader, &mut printer, writer, *input_file)
|
|
|
|
self.print_file(reader, &mut printer, writer, *input_file)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -42,6 +50,8 @@ impl<'b> Controller<'b> {
|
|
|
|
no_errors = false;
|
|
|
|
no_errors = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Ok(no_errors)
|
|
|
|
Ok(no_errors)
|
|
|
|
}
|
|
|
|
}
|
|
|
|