result
} else {
match result {
- Ok(_) => Ok(()),
+ Ok(()) => Ok(()),
Err(e) => {
- eprintln!("{}", e);
+ eprintln!("{e}");
std::process::exit(1);
}
}
let command_chain: Vec<Box<dyn Command>> = before_commands
.into_iter()
.chain(once(main_command))
- .chain(after_commands.into_iter())
+ .chain(after_commands)
.collect();
for command in command_chain {
- let result = command.execute(arguments.get(2), &configuration, command_name);
- if let Err(_) = result {
- return result;
- }
+ command.execute(arguments.get(2), &configuration, command_name)?;
}
return Ok(());
}
}
- Help::new().execute(None, &configuration, &"help".to_string())
+ Help::new().execute(None, &configuration, "help")
}