tf-log-parser/src/main.rs
2023-03-27 19:21:20 +02:00

17 lines
404 B
Rust

use main_error::MainError;
use std::env::args;
use std::fs;
use std::io::stdout;
use tf_log_parser::parse;
fn main() -> Result<(), MainError> {
let path = args().nth(1).expect("No path provided");
let content = fs::read(path)?;
let content = String::from_utf8_lossy(&content);
let log = parse(&content)?;
serde_json::to_writer_pretty(stdout().lock(), &log).unwrap();
Ok(())
}