mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-04 19:20:03 +00:00
Fix error reporting in main and move all arg validation into fn args::parse
(#585)
* Fix reporting parsing error from `args::parse` Report it in `args::parse` by using `Args::command().error(...).exit()` instead of returning `BinstallError`. * Rm unused variant `BinstallError::OverrideOptionUsedWithMultiInstall` * Refactor: Move `strategies` validation into `args::parse` * Rm unused variant `BinstallError::InvalidStrategies` * Add new unit test `args::test::verify_cli` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
b564b8ac4e
commit
a69db83aa6
4 changed files with 114 additions and 122 deletions
|
@ -18,10 +18,7 @@ fn main() -> MainExit {
|
|||
// This must be the very first thing to happen
|
||||
let jobserver_client = LazyJobserverClient::new();
|
||||
|
||||
let args = match args::parse() {
|
||||
Ok(args) => args,
|
||||
Err(err) => return MainExit::Error(err),
|
||||
};
|
||||
let args = args::parse();
|
||||
|
||||
if args.version {
|
||||
println!("{}", env!("CARGO_PKG_VERSION"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue