mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
cp: use new clap error mechanism
This commit is contained in:
parent
2409726258
commit
c7b7f19559
1 changed files with 2 additions and 2 deletions
|
@ -57,7 +57,7 @@ use std::path::{Path, PathBuf, StripPrefixError};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::string::ToString;
|
use std::string::ToString;
|
||||||
use uucore::backup_control::{self, BackupMode};
|
use uucore::backup_control::{self, BackupMode};
|
||||||
use uucore::error::{set_exit_code, ExitCode, UError, UResult};
|
use uucore::error::{set_exit_code, ExitCode, UClapError, UError, UResult};
|
||||||
use uucore::fs::{canonicalize, MissingHandling, ResolveMode};
|
use uucore::fs::{canonicalize, MissingHandling, ResolveMode};
|
||||||
use walkdir::WalkDir;
|
use walkdir::WalkDir;
|
||||||
|
|
||||||
|
@ -485,7 +485,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
app.print_help()?;
|
app.print_help()?;
|
||||||
}
|
}
|
||||||
clap::ErrorKind::DisplayVersion => println!("{}", app.render_version()),
|
clap::ErrorKind::DisplayVersion => println!("{}", app.render_version()),
|
||||||
_ => return Err(Box::new(e)),
|
_ => return Err(Box::new(e.with_exit_code(1))),
|
||||||
};
|
};
|
||||||
} else if let Ok(matches) = matches {
|
} else if let Ok(matches) = matches {
|
||||||
let options = Options::from_matches(&matches)?;
|
let options = Options::from_matches(&matches)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue