Detect sections; Unify printing help across the tools

This commit is contained in:
Jaby Blubb
2023-06-25 16:38:29 +02:00
parent d342f6ebc4
commit 1f8a366b6c
9 changed files with 23 additions and 9 deletions

View File

@@ -1,8 +1,17 @@
pub mod types;
use tool_helper::{Error, Input};
use std::io::BufRead;
use types::Section;
pub fn scan(input: Input) -> Result<Vec<Section>, Error> {
let lines = input.lines().map(|l| l.unwrap());
for line in lines {
if line.starts_with('.') {
println!("Found section \"{}\"", line);
}
}
Err(Error::not_implemented("readmap::scan"))
}

View File

@@ -25,7 +25,7 @@ pub fn main() {
}
},
Err(error) => {
exit_with_error(Error::from_error(error));
println!("{}", error)
}
}
}