1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 04:27:45 +00:00

pwd: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 14:40:31 +01:00
parent edafc468ed
commit d52887e6c0
2 changed files with 7 additions and 7 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/pwd.rs" path = "src/pwd.rs"
[dependencies] [dependencies]
clap = { version = "2.33", features = ["wrap_help"] } clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }

View file

@ -128,7 +128,7 @@ fn usage() -> String {
pub fn uumain(args: impl uucore::Args) -> UResult<()> { pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage(); let usage = usage();
let matches = uu_app().usage(&usage[..]).get_matches_from(args); let matches = uu_app().override_usage(&usage[..]).get_matches_from(args);
let cwd = if matches.is_present(OPT_LOGICAL) { let cwd = if matches.is_present(OPT_LOGICAL) {
logical_path() logical_path()
} else { } else {
@ -152,19 +152,19 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(()) Ok(())
} }
pub fn uu_app() -> App<'static, 'static> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.arg( .arg(
Arg::with_name(OPT_LOGICAL) Arg::new(OPT_LOGICAL)
.short("L") .short('L')
.long(OPT_LOGICAL) .long(OPT_LOGICAL)
.help("use PWD from environment, even if it contains symlinks"), .help("use PWD from environment, even if it contains symlinks"),
) )
.arg( .arg(
Arg::with_name(OPT_PHYSICAL) Arg::new(OPT_PHYSICAL)
.short("P") .short('P')
.long(OPT_PHYSICAL) .long(OPT_PHYSICAL)
.overrides_with(OPT_LOGICAL) .overrides_with(OPT_LOGICAL)
.help("avoid all symlinks"), .help("avoid all symlinks"),