diff --git a/src/uu/base32/src/base_common.rs b/src/uu/base32/src/base_common.rs index 148bad2f8..90221f4f6 100644 --- a/src/uu/base32/src/base_common.rs +++ b/src/uu/base32/src/base_common.rs @@ -123,7 +123,12 @@ pub fn base_app<'a>(about: &'a str, usage: &'a str) -> Command<'a> { ) // "multiple" arguments are used to check whether there is more than one // file passed in. - .arg(Arg::new(options::FILE).index(1).multiple_occurrences(true)) + .arg( + Arg::new(options::FILE) + .index(1) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), + ) } pub fn get_input<'a>(config: &Config, stdin_ref: &'a Stdin) -> UResult> { diff --git a/src/uu/basename/src/basename.rs b/src/uu/basename/src/basename.rs index 7b0a0a486..242a6a6e9 100644 --- a/src/uu/basename/src/basename.rs +++ b/src/uu/basename/src/basename.rs @@ -102,6 +102,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::NAME) .multiple_occurrences(true) + .value_hint(clap::ValueHint::AnyPath) .hide(true), ) .arg( diff --git a/src/uu/cat/src/cat.rs b/src/uu/cat/src/cat.rs index 67de917f7..cd10b5251 100644 --- a/src/uu/cat/src/cat.rs +++ b/src/uu/cat/src/cat.rs @@ -249,7 +249,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::SHOW_ALL) diff --git a/src/uu/chcon/src/chcon.rs b/src/uu/chcon/src/chcon.rs index e49191ea3..3458a4cca 100644 --- a/src/uu/chcon/src/chcon.rs +++ b/src/uu/chcon/src/chcon.rs @@ -197,6 +197,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::REFERENCE) .takes_value(true) .value_name("RFILE") + .value_hint(clap::ValueHint::FilePath) .conflicts_with_all(&[options::USER, options::ROLE, options::TYPE, options::RANGE]) .help( "Use security context of RFILE, rather than specifying \ @@ -210,6 +211,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::USER) .takes_value(true) .value_name("USER") + .value_hint(clap::ValueHint::Username) .help("Set user USER in the target security context.") .allow_invalid_utf8(true), ) @@ -294,6 +296,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new("FILE") .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath) .min_values(1) .allow_invalid_utf8(true), ) diff --git a/src/uu/chgrp/src/chgrp.rs b/src/uu/chgrp/src/chgrp.rs index d7e8baafe..015f09982 100644 --- a/src/uu/chgrp/src/chgrp.rs +++ b/src/uu/chgrp/src/chgrp.rs @@ -113,6 +113,7 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::REFERENCE) .long(options::REFERENCE) .value_name("RFILE") + .value_hint(clap::ValueHint::FilePath) .help("use RFILE's group rather than specifying GROUP values") .takes_value(true) .multiple_occurrences(false), diff --git a/src/uu/chmod/src/chmod.rs b/src/uu/chmod/src/chmod.rs index 25a37c372..d4b81ee37 100644 --- a/src/uu/chmod/src/chmod.rs +++ b/src/uu/chmod/src/chmod.rs @@ -157,6 +157,7 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::REFERENCE) .long("reference") .takes_value(true) + .value_hint(clap::ValueHint::FilePath) .help("use RFILE's mode instead of MODE values"), ) .arg( @@ -170,7 +171,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .required_unless_present(options::MODE) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::AnyPath), ) } diff --git a/src/uu/chown/src/chown.rs b/src/uu/chown/src/chown.rs index 3add9df1f..e66e105fb 100644 --- a/src/uu/chown/src/chown.rs +++ b/src/uu/chown/src/chown.rs @@ -134,6 +134,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::REFERENCE) .help("use RFILE's owner and group rather than specifying OWNER:GROUP values") .value_name("RFILE") + .value_hint(clap::ValueHint::FilePath) .min_values(1), ) .arg( diff --git a/src/uu/chroot/src/chroot.rs b/src/uu/chroot/src/chroot.rs index e54cc3f8f..30cf75644 100644 --- a/src/uu/chroot/src/chroot.rs +++ b/src/uu/chroot/src/chroot.rs @@ -102,6 +102,7 @@ pub fn uu_app<'a>() -> Command<'a> { .infer_long_args(true) .arg( Arg::new(options::NEWROOT) + .value_hint(clap::ValueHint::DirPath) .hide(true) .required(true) .index(1), @@ -139,6 +140,7 @@ pub fn uu_app<'a>() -> Command<'a> { ) .arg( Arg::new(options::COMMAND) + .value_hint(clap::ValueHint::CommandName) .hide(true) .multiple_occurrences(true) .index(2), diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index e901e0820..e9a5c5620 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -150,6 +150,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/comm/src/comm.rs b/src/uu/comm/src/comm.rs index 2207493d3..78ef4e5c2 100644 --- a/src/uu/comm/src/comm.rs +++ b/src/uu/comm/src/comm.rs @@ -173,6 +173,14 @@ pub fn uu_app<'a>() -> Command<'a> { .default_value(options::DELIMITER_DEFAULT) .hide_default_value(true), ) - .arg(Arg::new(options::FILE_1).required(true)) - .arg(Arg::new(options::FILE_2).required(true)) + .arg( + Arg::new(options::FILE_1) + .required(true) + .value_hint(clap::ValueHint::FilePath), + ) + .arg( + Arg::new(options::FILE_2) + .required(true) + .value_hint(clap::ValueHint::FilePath), + ) } diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 1b47b7828..41466abc8 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -314,6 +314,7 @@ pub fn uu_app<'a>() -> Command<'a> { .conflicts_with(options::NO_TARGET_DIRECTORY) .long(options::TARGET_DIRECTORY) .value_name(options::TARGET_DIRECTORY) + .value_hint(clap::ValueHint::DirPath) .takes_value(true) .validator(|s| { if Path::new(s).is_dir() { @@ -464,7 +465,8 @@ pub fn uu_app<'a>() -> Command<'a> { // END TODO .arg(Arg::new(options::PATHS) - .multiple_occurrences(true)) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::AnyPath)) } #[uucore::main] diff --git a/src/uu/csplit/src/csplit.rs b/src/uu/csplit/src/csplit.rs index a0b739935..2ef6b34f9 100644 --- a/src/uu/csplit/src/csplit.rs +++ b/src/uu/csplit/src/csplit.rs @@ -797,7 +797,12 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::ELIDE_EMPTY_FILES) .help("remove empty output files"), ) - .arg(Arg::new(options::FILE).hide(true).required(true)) + .arg( + Arg::new(options::FILE) + .hide(true) + .required(true) + .value_hint(clap::ValueHint::FilePath), + ) .arg( Arg::new(options::PATTERN) .hide(true) diff --git a/src/uu/cut/src/cut.rs b/src/uu/cut/src/cut.rs index 2264f4f26..b809b765d 100644 --- a/src/uu/cut/src/cut.rs +++ b/src/uu/cut/src/cut.rs @@ -614,6 +614,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath) ) } diff --git a/src/uu/date/src/date.rs b/src/uu/date/src/date.rs index 8946768d5..ca18856d1 100644 --- a/src/uu/date/src/date.rs +++ b/src/uu/date/src/date.rs @@ -272,6 +272,7 @@ pub fn uu_app<'a>() -> Command<'a> { .short('f') .long(OPT_FILE) .takes_value(true) + .value_hint(clap::ValueHint::FilePath) .help("like --date; once for each line of DATEFILE"), ) .arg( @@ -303,6 +304,7 @@ pub fn uu_app<'a>() -> Command<'a> { .short('r') .long(OPT_REFERENCE) .takes_value(true) + .value_hint(clap::ValueHint::AnyPath) .help("display the last modification time of FILE"), ) .arg( diff --git a/src/uu/dd/src/dd.rs b/src/uu/dd/src/dd.rs index 3f1a54b1c..115da8bcc 100644 --- a/src/uu/dd/src/dd.rs +++ b/src/uu/dd/src/dd.rs @@ -742,6 +742,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::INFILE) .overrides_with(options::INFILE) .takes_value(true) + .value_hint(clap::ValueHint::FilePath) .require_equals(true) .value_name("FILE") .help("(alternatively if=FILE) specifies the file used for input. When not specified, stdin is used instead") @@ -751,6 +752,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::OUTFILE) .overrides_with(options::OUTFILE) .takes_value(true) + .value_hint(clap::ValueHint::FilePath) .require_equals(true) .value_name("FILE") .help("(alternatively of=FILE) specifies the file used for output. When not specified, stdout is used instead") diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index a11dcf7a0..1f59982b2 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -583,7 +583,11 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .help("limit listing to file systems not of type TYPE"), ) - .arg(Arg::new(OPT_PATHS).multiple_occurrences(true)) + .arg( + Arg::new(OPT_PATHS) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::AnyPath), + ) } #[cfg(test)] diff --git a/src/uu/dircolors/src/dircolors.rs b/src/uu/dircolors/src/dircolors.rs index c76dbc0c1..78cf8d802 100644 --- a/src/uu/dircolors/src/dircolors.rs +++ b/src/uu/dircolors/src/dircolors.rs @@ -187,6 +187,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) + .value_hint(clap::ValueHint::FilePath) .multiple_occurrences(true), ) } diff --git a/src/uu/dirname/src/dirname.rs b/src/uu/dirname/src/dirname.rs index 030c3981c..ac37e513b 100644 --- a/src/uu/dirname/src/dirname.rs +++ b/src/uu/dirname/src/dirname.rs @@ -88,5 +88,10 @@ pub fn uu_app<'a>() -> Command<'a> { .short('z') .help("separate output with NUL rather than newline"), ) - .arg(Arg::new(options::DIR).hide(true).multiple_occurrences(true)) + .arg( + Arg::new(options::DIR) + .hide(true) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::AnyPath), + ) } diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index b29a938a4..d358d3e8f 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -884,6 +884,7 @@ pub fn uu_app<'a>() -> Command<'a> { .short('X') .long("exclude-from") .value_name("FILE") + .value_hint(clap::ValueHint::FilePath) .help("exclude files that match any pattern in FILE") .multiple_occurrences(true) @@ -913,6 +914,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) + .value_hint(clap::ValueHint::AnyPath) .multiple_occurrences(true) ) } diff --git a/src/uu/env/src/env.rs b/src/uu/env/src/env.rs index 2ec0ce1c6..a42621dad 100644 --- a/src/uu/env/src/env.rs +++ b/src/uu/env/src/env.rs @@ -144,6 +144,7 @@ pub fn uu_app<'a>() -> Command<'a> { .takes_value(true) .number_of_values(1) .value_name("DIR") + .value_hint(clap::ValueHint::DirPath) .help("change working directory to DIR")) .arg(Arg::new("null") .short('0') @@ -156,6 +157,7 @@ pub fn uu_app<'a>() -> Command<'a> { .takes_value(true) .number_of_values(1) .value_name("PATH") + .value_hint(clap::ValueHint::FilePath) .multiple_occurrences(true) .help("read and set variables from a \".env\"-style configuration file (prior to any \ unset and/or set)")) diff --git a/src/uu/expand/src/expand.rs b/src/uu/expand/src/expand.rs index b9d9309cd..117615162 100644 --- a/src/uu/expand/src/expand.rs +++ b/src/uu/expand/src/expand.rs @@ -207,6 +207,7 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .hide(true) .takes_value(true) + .value_hint(clap::ValueHint::FilePath) ) } diff --git a/src/uu/fmt/src/fmt.rs b/src/uu/fmt/src/fmt.rs index 3cb851674..27afb689f 100644 --- a/src/uu/fmt/src/fmt.rs +++ b/src/uu/fmt/src/fmt.rs @@ -344,6 +344,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(ARG_FILES) .multiple_occurrences(true) - .takes_value(true), + .takes_value(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/fold/src/fold.rs b/src/uu/fold/src/fold.rs index d24d31be9..b2806eb01 100644 --- a/src/uu/fold/src/fold.rs +++ b/src/uu/fold/src/fold.rs @@ -99,7 +99,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/groups/src/groups.rs b/src/uu/groups/src/groups.rs index cd0d05b07..dd2188033 100644 --- a/src/uu/groups/src/groups.rs +++ b/src/uu/groups/src/groups.rs @@ -112,6 +112,7 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::USERS) .multiple_occurrences(true) .takes_value(true) - .value_name(options::USERS), + .value_name(options::USERS) + .value_hint(clap::ValueHint::Username), ) } diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index 244e4b928..872cb5c21 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -423,6 +423,7 @@ pub fn uu_app_common<'a>() -> Command<'a> { .index(1) .multiple_occurrences(true) .value_name("FILE") + .value_hint(clap::ValueHint::FilePath) .allow_invalid_utf8(true), ) } diff --git a/src/uu/head/src/head.rs b/src/uu/head/src/head.rs index b6d36a4ad..01f08ff93 100644 --- a/src/uu/head/src/head.rs +++ b/src/uu/head/src/head.rs @@ -107,7 +107,11 @@ pub fn uu_app<'a>() -> Command<'a> { .help("line delimiter is NUL, not newline") .overrides_with(options::ZERO_NAME), ) - .arg(Arg::new(options::FILES_NAME).multiple_occurrences(true)) + .arg( + Arg::new(options::FILES_NAME) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), + ) } #[derive(Debug, PartialEq)] diff --git a/src/uu/hostname/src/hostname.rs b/src/uu/hostname/src/hostname.rs index 757caed02..11b0d6cdb 100644 --- a/src/uu/hostname/src/hostname.rs +++ b/src/uu/hostname/src/hostname.rs @@ -105,7 +105,11 @@ pub fn uu_app<'a>() -> Command<'a> { .overrides_with_all(&[OPT_DOMAIN, OPT_IP_ADDRESS, OPT_FQDN, OPT_SHORT]) .help("Display the short hostname (the portion before the first dot) if possible"), ) - .arg(Arg::new(OPT_HOST).allow_invalid_utf8(true)) + .arg( + Arg::new(OPT_HOST) + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::Hostname), + ) } fn display_hostname(matches: &ArgMatches) -> UResult<()> { diff --git a/src/uu/id/src/id.rs b/src/uu/id/src/id.rs index cc23ce19f..bb8e261d2 100644 --- a/src/uu/id/src/id.rs +++ b/src/uu/id/src/id.rs @@ -443,7 +443,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::ARG_USERS) .multiple_occurrences(true) .takes_value(true) - .value_name(options::ARG_USERS), + .value_name(options::ARG_USERS) + .value_hint(clap::ValueHint::Username), ) } diff --git a/src/uu/install/src/install.rs b/src/uu/install/src/install.rs index 808898cfb..6750560d2 100644 --- a/src/uu/install/src/install.rs +++ b/src/uu/install/src/install.rs @@ -248,6 +248,7 @@ pub fn uu_app<'a>() -> Command<'a> { .help("set ownership (super-user only)") .value_name("OWNER") .takes_value(true) + .value_hint(clap::ValueHint::Username) ) .arg( Arg::new(OPT_PRESERVE_TIMESTAMPS) @@ -266,6 +267,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(OPT_STRIP_PROGRAM) .help("program used to strip binaries (no action Windows)") .value_name("PROGRAM") + .value_hint(clap::ValueHint::CommandName) ) .arg( backup_control::arguments::suffix() @@ -277,6 +279,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(OPT_TARGET_DIRECTORY) .help("move all SOURCE arguments into DIRECTORY") .value_name("DIRECTORY") + .value_hint(clap::ValueHint::DirPath) ) .arg( // TODO implement flag @@ -307,7 +310,13 @@ pub fn uu_app<'a>() -> Command<'a> { .help("(unimplemented) set security context of files and directories") .value_name("CONTEXT") ) - .arg(Arg::new(ARG_FILES).multiple_occurrences(true).takes_value(true).min_values(1)) + .arg( + Arg::new(ARG_FILES) + .multiple_occurrences(true) + .takes_value(true) + .min_values(1) + .value_hint(clap::ValueHint::AnyPath) + ) } /// Check for unimplemented command line arguments. diff --git a/src/uu/join/src/join.rs b/src/uu/join/src/join.rs index ef19fe328..20a8cbd28 100644 --- a/src/uu/join/src/join.rs +++ b/src/uu/join/src/join.rs @@ -801,12 +801,14 @@ FILENUM is 1 or 2, corresponding to FILE1 or FILE2", Arg::new("file1") .required(true) .value_name("FILE1") + .value_hint(clap::ValueHint::FilePath) .hide(true), ) .arg( Arg::new("file2") .required(true) .value_name("FILE2") + .value_hint(clap::ValueHint::FilePath) .hide(true), ) } diff --git a/src/uu/link/src/link.rs b/src/uu/link/src/link.rs index 3c959af33..1fc0c49ce 100644 --- a/src/uu/link/src/link.rs +++ b/src/uu/link/src/link.rs @@ -46,6 +46,7 @@ pub fn uu_app<'a>() -> Command<'a> { .min_values(2) .max_values(2) .takes_value(true) + .value_hint(clap::ValueHint::AnyPath) .allow_invalid_utf8(true), ) } diff --git a/src/uu/ln/src/ln.rs b/src/uu/ln/src/ln.rs index 088edf219..fdbb32311 100644 --- a/src/uu/ln/src/ln.rs +++ b/src/uu/ln/src/ln.rs @@ -232,6 +232,7 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::TARGET_DIRECTORY) .help("specify the DIRECTORY in which to create the links") .value_name("DIRECTORY") + .value_hint(clap::ValueHint::DirPath) .conflicts_with(options::NO_TARGET_DIRECTORY), ) .arg( @@ -257,6 +258,7 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(ARG_FILES) .multiple_occurrences(true) .takes_value(true) + .value_hint(clap::ValueHint::AnyPath) .required(true) .min_values(1), ) diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 17eec91ec..20d960c51 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -1402,7 +1402,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::PATHS) .multiple_occurrences(true) .takes_value(true) - .allow_invalid_utf8(true), + .value_hint(clap::ValueHint::AnyPath) + .allow_invalid_utf8(true) ) .after_help( "The TIME_STYLE argument can be full-iso, long-iso, iso. \ diff --git a/src/uu/mkdir/src/mkdir.rs b/src/uu/mkdir/src/mkdir.rs index b1d7583d3..6ba58c2bb 100644 --- a/src/uu/mkdir/src/mkdir.rs +++ b/src/uu/mkdir/src/mkdir.rs @@ -137,7 +137,8 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .takes_value(true) .min_values(1) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::DirPath), ) } diff --git a/src/uu/mkfifo/src/mkfifo.rs b/src/uu/mkfifo/src/mkfifo.rs index 756fd75cf..b14ae8bed 100644 --- a/src/uu/mkfifo/src/mkfifo.rs +++ b/src/uu/mkfifo/src/mkfifo.rs @@ -102,6 +102,7 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FIFO) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::AnyPath), ) } diff --git a/src/uu/mknod/src/mknod.rs b/src/uu/mknod/src/mknod.rs index 0e7c4be45..fdd57aa01 100644 --- a/src/uu/mknod/src/mknod.rs +++ b/src/uu/mknod/src/mknod.rs @@ -162,7 +162,8 @@ pub fn uu_app<'a>() -> Command<'a> { .value_name("NAME") .help("name of the new file") .required(true) - .index(1), + .index(1) + .value_hint(clap::ValueHint::AnyPath), ) .arg( Arg::new("type") diff --git a/src/uu/mktemp/src/mktemp.rs b/src/uu/mktemp/src/mktemp.rs index 94def4874..20b95f009 100644 --- a/src/uu/mktemp/src/mktemp.rs +++ b/src/uu/mktemp/src/mktemp.rs @@ -202,7 +202,8 @@ pub fn uu_app<'a>() -> Command<'a> { be an absolute name; unlike with -t, TEMPLATE may contain \ slashes, but mktemp creates only the final component", ) - .value_name("DIR"), + .value_name("DIR") + .value_hint(clap::ValueHint::DirPath), ) .arg(Arg::new(OPT_T).short('t').help( "Generate a template (using the supplied prefix and TMPDIR (TMP on windows) if set) \ diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index ab94bd435..711d2b214 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -183,7 +183,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::FILES) .required(false) .multiple_occurrences(true) - .help("Path to the files to be read"), + .help("Path to the files to be read") + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/mv/src/mv.rs b/src/uu/mv/src/mv.rs index 1c2390f80..fa8284061 100644 --- a/src/uu/mv/src/mv.rs +++ b/src/uu/mv/src/mv.rs @@ -156,14 +156,15 @@ pub fn uu_app<'a>() -> Command<'a> { .help("move all SOURCE arguments into DIRECTORY") .takes_value(true) .value_name("DIRECTORY") + .value_hint(clap::ValueHint::DirPath) .conflicts_with(OPT_NO_TARGET_DIRECTORY) .allow_invalid_utf8(true) ) .arg( Arg::new(OPT_NO_TARGET_DIRECTORY) .short('T') - .long(OPT_NO_TARGET_DIRECTORY). - help("treat DEST as a normal file") + .long(OPT_NO_TARGET_DIRECTORY) + .help("treat DEST as a normal file") ) .arg( Arg::new(OPT_UPDATE) @@ -183,6 +184,7 @@ pub fn uu_app<'a>() -> Command<'a> { .min_values(2) .required(true) .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::AnyPath) ) } diff --git a/src/uu/nice/src/nice.rs b/src/uu/nice/src/nice.rs index e78de828b..f0d663bcc 100644 --- a/src/uu/nice/src/nice.rs +++ b/src/uu/nice/src/nice.rs @@ -117,5 +117,9 @@ pub fn uu_app<'a>() -> Command<'a> { .takes_value(true) .allow_hyphen_values(true), ) - .arg(Arg::new(options::COMMAND).multiple_occurrences(true)) + .arg( + Arg::new(options::COMMAND) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::CommandName), + ) } diff --git a/src/uu/nl/src/nl.rs b/src/uu/nl/src/nl.rs index 28cf3fb4d..e6ca7f931 100644 --- a/src/uu/nl/src/nl.rs +++ b/src/uu/nl/src/nl.rs @@ -154,7 +154,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::BODY_NUMBERING) diff --git a/src/uu/nohup/src/nohup.rs b/src/uu/nohup/src/nohup.rs index 0d67ad466..6f605ac4f 100644 --- a/src/uu/nohup/src/nohup.rs +++ b/src/uu/nohup/src/nohup.rs @@ -126,7 +126,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::CMD) .hide(true) .required(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::CommandName), ) .trailing_var_arg(true) .infer_long_args(true) diff --git a/src/uu/od/src/od.rs b/src/uu/od/src/od.rs index 33fac39d3..168213dae 100644 --- a/src/uu/od/src/od.rs +++ b/src/uu/od/src/od.rs @@ -512,7 +512,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILENAME) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/paste/src/paste.rs b/src/uu/paste/src/paste.rs index 2826a19e3..682e66a5d 100644 --- a/src/uu/paste/src/paste.rs +++ b/src/uu/paste/src/paste.rs @@ -71,7 +71,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::FILE) .value_name("FILE") .multiple_occurrences(true) - .default_value("-"), + .default_value("-") + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/pathchk/src/pathchk.rs b/src/uu/pathchk/src/pathchk.rs index 6260590aa..0f21448cf 100644 --- a/src/uu/pathchk/src/pathchk.rs +++ b/src/uu/pathchk/src/pathchk.rs @@ -108,7 +108,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::PATH) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::AnyPath), ) } diff --git a/src/uu/pinky/src/pinky.rs b/src/uu/pinky/src/pinky.rs index 4a793944f..b5217afe4 100644 --- a/src/uu/pinky/src/pinky.rs +++ b/src/uu/pinky/src/pinky.rs @@ -179,7 +179,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::USER) .takes_value(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::Username), ) .arg( // Redefine the help argument to not include the short flag diff --git a/src/uu/pr/src/pr.rs b/src/uu/pr/src/pr.rs index ca12f0be0..682e9b6d4 100644 --- a/src/uu/pr/src/pr.rs +++ b/src/uu/pr/src/pr.rs @@ -372,6 +372,7 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::FILES) .multiple_occurrences(true) .multiple_values(true) + .value_hint(clap::ValueHint::FilePath) ) } diff --git a/src/uu/ptx/src/ptx.rs b/src/uu/ptx/src/ptx.rs index 2f253b580..9cdad7ccf 100644 --- a/src/uu/ptx/src/ptx.rs +++ b/src/uu/ptx/src/ptx.rs @@ -754,7 +754,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::AUTO_REFERENCE) @@ -826,7 +827,8 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::BREAK_FILE) .help("word break characters in this FILE") .value_name("FILE") - .takes_value(true), + .takes_value(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::IGNORE_CASE) @@ -849,7 +851,8 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::IGNORE_FILE) .help("read ignore word list from FILE") .value_name("FILE") - .takes_value(true), + .takes_value(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::ONLY_FILE) @@ -857,7 +860,8 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::ONLY_FILE) .help("read only word list from this FILE") .value_name("FILE") - .takes_value(true), + .takes_value(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::REFERENCES) diff --git a/src/uu/readlink/src/readlink.rs b/src/uu/readlink/src/readlink.rs index ba1e368f2..10d75e7ef 100644 --- a/src/uu/readlink/src/readlink.rs +++ b/src/uu/readlink/src/readlink.rs @@ -161,7 +161,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(ARG_FILES) .multiple_occurrences(true) - .takes_value(true), + .takes_value(true) + .value_hint(clap::ValueHint::AnyPath), ) } diff --git a/src/uu/realpath/src/realpath.rs b/src/uu/realpath/src/realpath.rs index bea89c19e..403e7c456 100644 --- a/src/uu/realpath/src/realpath.rs +++ b/src/uu/realpath/src/realpath.rs @@ -130,7 +130,8 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .takes_value(true) .required(true) - .min_values(1), + .min_values(1) + .value_hint(clap::ValueHint::AnyPath), ) } diff --git a/src/uu/relpath/src/relpath.rs b/src/uu/relpath/src/relpath.rs index 2e45ce927..336e2192d 100644 --- a/src/uu/relpath/src/relpath.rs +++ b/src/uu/relpath/src/relpath.rs @@ -87,6 +87,15 @@ pub fn uu_app<'a>() -> Command<'a> { .arg(Arg::new(options::DIR).short('d').takes_value(true).help( "If any of FROM and TO is not subpath of DIR, output absolute path instead of relative", )) - .arg(Arg::new(options::TO).required(true).takes_value(true)) - .arg(Arg::new(options::FROM).takes_value(true)) + .arg( + Arg::new(options::TO) + .required(true) + .takes_value(true) + .value_hint(clap::ValueHint::AnyPath), + ) + .arg( + Arg::new(options::FROM) + .takes_value(true) + .value_hint(clap::ValueHint::AnyPath), + ) } diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index 0701387d9..4f69c8fb1 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -227,6 +227,7 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .takes_value(true) .min_values(1) + .value_hint(clap::ValueHint::AnyPath) ) } diff --git a/src/uu/rmdir/src/rmdir.rs b/src/uu/rmdir/src/rmdir.rs index 127b8fcf9..be4e53780 100644 --- a/src/uu/rmdir/src/rmdir.rs +++ b/src/uu/rmdir/src/rmdir.rs @@ -197,6 +197,7 @@ pub fn uu_app<'a>() -> Command<'a> { .takes_value(true) .min_values(1) .required(true) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::DirPath), ) } diff --git a/src/uu/runcon/src/runcon.rs b/src/uu/runcon/src/runcon.rs index 8c20319be..64df4f381 100644 --- a/src/uu/runcon/src/runcon.rs +++ b/src/uu/runcon/src/runcon.rs @@ -156,7 +156,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new("ARG") .multiple_occurrences(true) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::CommandName), ) // Once "ARG" is parsed, everything after that belongs to it. // diff --git a/src/uu/shred/src/shred.rs b/src/uu/shred/src/shred.rs index 05c8d1805..7f1c97c77 100644 --- a/src/uu/shred/src/shred.rs +++ b/src/uu/shred/src/shred.rs @@ -374,7 +374,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/shuf/src/shuf.rs b/src/uu/shuf/src/shuf.rs index 0b62ec84a..6369fc9b5 100644 --- a/src/uu/shuf/src/shuf.rs +++ b/src/uu/shuf/src/shuf.rs @@ -158,14 +158,16 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::OUTPUT) .takes_value(true) .value_name("FILE") - .help("write result to FILE instead of standard output"), + .help("write result to FILE instead of standard output") + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::RANDOM_SOURCE) .long(options::RANDOM_SOURCE) .takes_value(true) .value_name("FILE") - .help("get random bytes from FILE"), + .help("get random bytes from FILE") + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::REPEAT) @@ -179,7 +181,11 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::ZERO_TERMINATED) .help("line delimiter is NUL, not newline"), ) - .arg(Arg::new(options::FILE).takes_value(true)) + .arg( + Arg::new(options::FILE) + .takes_value(true) + .value_hint(clap::ValueHint::FilePath), + ) } fn read_input_file(filename: &str) -> UResult> { diff --git a/src/uu/sort/src/sort.rs b/src/uu/sort/src/sort.rs index 141a7dd2c..15becdc6b 100644 --- a/src/uu/sort/src/sort.rs +++ b/src/uu/sort/src/sort.rs @@ -1397,7 +1397,8 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::OUTPUT) .help("write output to FILENAME instead of stdout") .takes_value(true) - .value_name("FILENAME"), + .value_name("FILENAME") + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::REVERSE) @@ -1461,13 +1462,15 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::TMP_DIR) .help("use DIR for temporaries, not $TMPDIR or /tmp") .takes_value(true) - .value_name("DIR"), + .value_name("DIR") + .value_hint(clap::ValueHint::DirPath), ) .arg( Arg::new(options::COMPRESS_PROG) .long(options::COMPRESS_PROG) .help("compress temporary files with PROG, decompress with PROG -d; PROG has to take input from stdin and output to stdout") - .value_name("PROG"), + .value_name("PROG") + .value_hint(clap::ValueHint::CommandName), ) .arg( Arg::new(options::BATCH_SIZE) @@ -1482,7 +1485,8 @@ pub fn uu_app<'a>() -> Command<'a> { .takes_value(true) .value_name("NUL_FILES") .multiple_occurrences(true) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::DEBUG) @@ -1493,7 +1497,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::FILES) .multiple_occurrences(true) .takes_value(true) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/split/src/split.rs b/src/uu/split/src/split.rs index c90c7a6b2..03905e877 100644 --- a/src/uu/split/src/split.rs +++ b/src/uu/split/src/split.rs @@ -111,9 +111,11 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(OPT_FILTER) .long(OPT_FILTER) .takes_value(true) + .value_name("COMMAND") + .value_hint(clap::ValueHint::CommandName) .help( - "write to shell COMMAND file name is $FILE (Currently not implemented for Windows)", - ), + "write to shell COMMAND; file name is $FILE (Currently not implemented for Windows)", + ), ) .arg( Arg::new(OPT_ELIDE_EMPTY_FILES) @@ -162,7 +164,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(ARG_INPUT) .takes_value(true) .default_value("-") - .index(1), + .index(1) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(ARG_PREFIX) diff --git a/src/uu/stat/src/stat.rs b/src/uu/stat/src/stat.rs index 41c9ae4a9..e261ab813 100644 --- a/src/uu/stat/src/stat.rs +++ b/src/uu/stat/src/stat.rs @@ -1043,6 +1043,7 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .takes_value(true) .allow_invalid_utf8(true) - .min_values(1), + .min_values(1) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/stdbuf/src/stdbuf.rs b/src/uu/stdbuf/src/stdbuf.rs index 816c86717..e0025d9f1 100644 --- a/src/uu/stdbuf/src/stdbuf.rs +++ b/src/uu/stdbuf/src/stdbuf.rs @@ -232,6 +232,7 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .takes_value(true) .hide(true) - .required(true), + .required(true) + .value_hint(clap::ValueHint::CommandName), ) } diff --git a/src/uu/sum/src/sum.rs b/src/uu/sum/src/sum.rs index 501635910..9280fcf81 100644 --- a/src/uu/sum/src/sum.rs +++ b/src/uu/sum/src/sum.rs @@ -150,7 +150,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .multiple_occurrences(true) - .hide(true), + .hide(true) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::BSD_COMPATIBLE) diff --git a/src/uu/sync/src/sync.rs b/src/uu/sync/src/sync.rs index 9baf9b182..6f34c11b7 100644 --- a/src/uu/sync/src/sync.rs +++ b/src/uu/sync/src/sync.rs @@ -217,7 +217,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(ARG_FILES) .multiple_occurrences(true) - .takes_value(true), + .takes_value(true) + .value_hint(clap::ValueHint::AnyPath), ) } diff --git a/src/uu/tac/src/tac.rs b/src/uu/tac/src/tac.rs index 3151b97e2..62d578ee9 100644 --- a/src/uu/tac/src/tac.rs +++ b/src/uu/tac/src/tac.rs @@ -91,7 +91,8 @@ pub fn uu_app<'a>() -> Command<'a> { .arg( Arg::new(options::FILE) .hide(true) - .multiple_occurrences(true), + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/tail/src/tail.rs b/src/uu/tail/src/tail.rs index 96b6daf79..8f5a62e61 100644 --- a/src/uu/tail/src/tail.rs +++ b/src/uu/tail/src/tail.rs @@ -351,7 +351,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::ARG_FILES) .multiple_occurrences(true) .takes_value(true) - .min_values(1), + .min_values(1) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/tee/src/tee.rs b/src/uu/tee/src/tee.rs index d9c2e78f1..7b6b66208 100644 --- a/src/uu/tee/src/tee.rs +++ b/src/uu/tee/src/tee.rs @@ -74,7 +74,11 @@ pub fn uu_app<'a>() -> Command<'a> { .short('i') .help("ignore interrupt signals (ignored on non-Unix platforms)"), ) - .arg(Arg::new(options::FILE).multiple_occurrences(true)) + .arg( + Arg::new(options::FILE) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath), + ) } #[cfg(unix)] diff --git a/src/uu/timeout/src/timeout.rs b/src/uu/timeout/src/timeout.rs index 8374c124c..baafce4df 100644 --- a/src/uu/timeout/src/timeout.rs +++ b/src/uu/timeout/src/timeout.rs @@ -170,6 +170,7 @@ pub fn uu_app<'a>() -> Command<'a> { .index(2) .required(true) .multiple_occurrences(true) + .value_hint(clap::ValueHint::CommandName) ) .trailing_var_arg(true) .infer_long_args(true) diff --git a/src/uu/touch/src/touch.rs b/src/uu/touch/src/touch.rs index f71eb81d0..c250953bc 100644 --- a/src/uu/touch/src/touch.rs +++ b/src/uu/touch/src/touch.rs @@ -219,7 +219,8 @@ pub fn uu_app<'a>() -> Command<'a> { .long(options::sources::REFERENCE) .help("use this file's times instead of the current time") .value_name("FILE") - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::AnyPath), ) .arg( Arg::new(options::TIME) @@ -238,7 +239,8 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .takes_value(true) .min_values(1) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::AnyPath), ) .group(ArgGroup::new(options::SOURCES).args(&[ options::sources::CURRENT, diff --git a/src/uu/tr/src/tr.rs b/src/uu/tr/src/tr.rs index dd8edc518..93465429f 100644 --- a/src/uu/tr/src/tr.rs +++ b/src/uu/tr/src/tr.rs @@ -143,7 +143,6 @@ pub fn uu_app<'a>() -> Command<'a> { .about(ABOUT) .override_usage(format_usage(USAGE)) .infer_long_args(true) - .infer_long_args(true) .arg( Arg::new(options::COMPLEMENT) .visible_short_alias('C') diff --git a/src/uu/truncate/src/truncate.rs b/src/uu/truncate/src/truncate.rs index 6c9d8197b..b3110dcc1 100644 --- a/src/uu/truncate/src/truncate.rs +++ b/src/uu/truncate/src/truncate.rs @@ -162,6 +162,7 @@ pub fn uu_app<'a>() -> Command<'a> { .required_unless_present(options::SIZE) .help("base the size of each file on the size of RFILE") .value_name("RFILE") + .value_hint(clap::ValueHint::FilePath) ) .arg( Arg::new(options::SIZE) @@ -176,7 +177,8 @@ pub fn uu_app<'a>() -> Command<'a> { .multiple_occurrences(true) .takes_value(true) .required(true) - .min_values(1)) + .min_values(1) + .value_hint(clap::ValueHint::FilePath)) } /// Truncate the named file to the specified size. diff --git a/src/uu/tsort/src/tsort.rs b/src/uu/tsort/src/tsort.rs index aecd492fe..72b8843e5 100644 --- a/src/uu/tsort/src/tsort.rs +++ b/src/uu/tsort/src/tsort.rs @@ -99,7 +99,12 @@ pub fn uu_app<'a>() -> Command<'a> { .override_usage(format_usage(USAGE)) .about(SUMMARY) .infer_long_args(true) - .arg(Arg::new(options::FILE).default_value("-").hide(true)) + .arg( + Arg::new(options::FILE) + .default_value("-") + .hide(true) + .value_hint(clap::ValueHint::FilePath), + ) } // We use String as a representation of node here diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index 70a763f3b..0ebfea613 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -109,7 +109,12 @@ pub fn uu_app<'a>() -> Command<'a> { .override_usage(format_usage(USAGE)) .about(SUMMARY) .infer_long_args(true) - .arg(Arg::new(options::FILE).hide(true).multiple_occurrences(true)) + .arg( + Arg::new(options::FILE) + .hide(true) + .multiple_occurrences(true) + .value_hint(clap::ValueHint::FilePath) + ) .arg( Arg::new(options::ALL) .short('a') diff --git a/src/uu/uniq/src/uniq.rs b/src/uu/uniq/src/uniq.rs index 32e0783ce..e71c21303 100644 --- a/src/uu/uniq/src/uniq.rs +++ b/src/uu/uniq/src/uniq.rs @@ -392,7 +392,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(ARG_FILES) .multiple_occurrences(true) .takes_value(true) - .max_values(2), + .max_values(2) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/unlink/src/unlink.rs b/src/uu/unlink/src/unlink.rs index fc72b4623..890935f1a 100644 --- a/src/uu/unlink/src/unlink.rs +++ b/src/uu/unlink/src/unlink.rs @@ -36,6 +36,7 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(OPT_PATH) .required(true) .hide(true) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::AnyPath), ) } diff --git a/src/uu/users/src/users.rs b/src/uu/users/src/users.rs index 79fac3b68..b1785d608 100644 --- a/src/uu/users/src/users.rs +++ b/src/uu/users/src/users.rs @@ -64,5 +64,10 @@ pub fn uu_app<'a>() -> Command<'a> { .about(ABOUT) .override_usage(format_usage(USAGE)) .infer_long_args(true) - .arg(Arg::new(ARG_FILES).takes_value(true).max_values(1)) + .arg( + Arg::new(ARG_FILES) + .takes_value(true) + .max_values(1) + .value_hint(clap::ValueHint::FilePath), + ) } diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index 968830c48..ba7c4c1af 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -210,7 +210,8 @@ pub fn uu_app<'a>() -> Command<'a> { "read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input", - ), + ) + .value_hint(clap::ValueHint::FilePath), ) .arg( Arg::new(options::LINES) @@ -234,7 +235,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(ARG_FILES) .multiple_occurrences(true) .takes_value(true) - .allow_invalid_utf8(true), + .allow_invalid_utf8(true) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uu/who/src/who.rs b/src/uu/who/src/who.rs index 47d96a381..6c07039d2 100644 --- a/src/uu/who/src/who.rs +++ b/src/uu/who/src/who.rs @@ -250,7 +250,8 @@ pub fn uu_app<'a>() -> Command<'a> { Arg::new(options::FILE) .takes_value(true) .min_values(1) - .max_values(2), + .max_values(2) + .value_hint(clap::ValueHint::FilePath), ) } diff --git a/src/uucore/src/lib/features/perms.rs b/src/uucore/src/lib/features/perms.rs index d8e345313..df37e5a69 100644 --- a/src/uucore/src/lib/features/perms.rs +++ b/src/uucore/src/lib/features/perms.rs @@ -456,6 +456,7 @@ pub fn chown_base<'a>( command = command.arg( Arg::new(options::ARG_FILES) .value_name(options::ARG_FILES) + .value_hint(clap::ValueHint::FilePath) .multiple_occurrences(true) .takes_value(true) .required(true)