mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
du: add -H (alias for --dereference-args)
This commit is contained in:
parent
1818632d7c
commit
7afb8461cb
2 changed files with 7 additions and 4 deletions
|
@ -821,6 +821,7 @@ pub fn uu_app() -> Command {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::DEREFERENCE_ARGS)
|
Arg::new(options::DEREFERENCE_ARGS)
|
||||||
.short('D')
|
.short('D')
|
||||||
|
.visible_short_alias('H')
|
||||||
.long(options::DEREFERENCE_ARGS)
|
.long(options::DEREFERENCE_ARGS)
|
||||||
.help("follow only symlinks that are listed on the command line")
|
.help("follow only symlinks that are listed on the command line")
|
||||||
.action(ArgAction::SetTrue)
|
.action(ArgAction::SetTrue)
|
||||||
|
|
|
@ -299,11 +299,13 @@ fn test_du_dereference_args() {
|
||||||
file2.write_all(b"amaz?ng").unwrap();
|
file2.write_all(b"amaz?ng").unwrap();
|
||||||
at.symlink_dir("subdir", "sublink");
|
at.symlink_dir("subdir", "sublink");
|
||||||
|
|
||||||
let result = ts.ucmd().arg("-D").arg("-s").arg("sublink").succeeds();
|
for arg in ["-D", "-H", "--dereference-args"] {
|
||||||
let stdout = result.stdout_str();
|
let result = ts.ucmd().arg(arg).arg("-s").arg("sublink").succeeds();
|
||||||
|
let stdout = result.stdout_str();
|
||||||
|
|
||||||
assert!(!stdout.starts_with('0'));
|
assert!(!stdout.starts_with('0'));
|
||||||
assert!(stdout.contains("sublink"));
|
assert!(stdout.contains("sublink"));
|
||||||
|
}
|
||||||
|
|
||||||
// Without the option
|
// Without the option
|
||||||
let result = ts.ucmd().arg("-s").arg("sublink").succeeds();
|
let result = ts.ucmd().arg("-s").arg("sublink").succeeds();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue