Detect sections; Unify printing help across the tools
This commit is contained in:
@@ -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"))
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ pub fn main() {
|
||||
}
|
||||
},
|
||||
Err(error) => {
|
||||
exit_with_error(Error::from_error(error));
|
||||
println!("{}", error)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user