Calling un-implemented convert function

This commit is contained in:
Jaby
2022-09-17 17:31:51 +02:00
committed by Jaby
parent 8931544f73
commit a5512085b5
3 changed files with 22 additions and 8 deletions

View File

@@ -20,9 +20,23 @@ enum SubCommands {
SimpleTIM(reduced_tim::Arguments)
}
fn main() {
fn run_main() -> tool_helper::Result<()> {
match CommandLine::try_parse() {
Ok(_cmd) => println!("Planschbecken"),
Err(error) => println!("{}", error.to_string())
}
Ok(cmd) => {
let input = tool_helper::open_input(cmd.input_file)?;
let output = tool_helper::open_output(cmd.output_file)?;
match cmd.sub_command {
SubCommands::SimpleTIM(args) => reduced_tim::convert(args, input, output),
}
},
Err(error) => Err(tool_helper::Error::new(error.to_string(), None))
}
}
fn main() {
if let Err(error) = run_main() {
println!("{}", error.text);
std::process::exit(error.exit_code);
}
}