Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
1 changed files with 33 additions and 38 deletions
Showing only changes of commit e8ae8a8798 - Show all commits

View File

@ -25,9 +25,7 @@ enum SubCommands {
SimpleTIM(reduced_tim::Arguments) SimpleTIM(reduced_tim::Arguments)
} }
fn run_main() -> Result<(), Error> { fn run_main(cmd: CommandLine) -> Result<(), Error> {
match CommandLine::try_parse() {
Ok(cmd) => {
let mut input = tool_helper::open_input(cmd.input_file)?; let mut input = tool_helper::open_input(cmd.input_file)?;
let mut buffer = Vec::<u8>::new(); let mut buffer = Vec::<u8>::new();
let mut output_file = tool_helper::open_output(cmd.output_file)?; let mut output_file = tool_helper::open_output(cmd.output_file)?;
@ -57,18 +55,15 @@ fn run_main() -> Result<(), Error> {
} }
Ok(()) Ok(())
},
Err(error) => Err({
let mut error = Error::from_error(error);
error.exit_code = 0;
error
})
}
} }
fn main() { fn main() {
if let Err(error) = run_main() { match CommandLine::try_parse() {
Ok(cmd) => {
if let Err(error) = run_main(cmd) {
exit_with_error(error); exit_with_error(error);
} }
},
Err(error) => eprintln!("{}", error)
}
} }