mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
pwd: clap 3
This commit is contained in:
parent
edafc468ed
commit
d52887e6c0
2 changed files with 7 additions and 7 deletions
|
@ -15,7 +15,7 @@ edition = "2018"
|
|||
path = "src/pwd.rs"
|
||||
|
||||
[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_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ fn usage() -> String {
|
|||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
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) {
|
||||
logical_path()
|
||||
} else {
|
||||
|
@ -152,19 +152,19 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
pub fn uu_app<'a>() -> App<'a> {
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
Arg::with_name(OPT_LOGICAL)
|
||||
.short("L")
|
||||
Arg::new(OPT_LOGICAL)
|
||||
.short('L')
|
||||
.long(OPT_LOGICAL)
|
||||
.help("use PWD from environment, even if it contains symlinks"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(OPT_PHYSICAL)
|
||||
.short("P")
|
||||
Arg::new(OPT_PHYSICAL)
|
||||
.short('P')
|
||||
.long(OPT_PHYSICAL)
|
||||
.overrides_with(OPT_LOGICAL)
|
||||
.help("avoid all symlinks"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue