mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
false,true: Implement custom help, version
This avoids hacking around the short options of these command line arguments that have been introduced by clap. Additionally, we test and correctly handle the combination of both version and help. The GNU binary will ignore both arguments in this case while clap would perform the first one. A test for this edge case was added.
This commit is contained in:
parent
c1e108933f
commit
23a544c485
4 changed files with 69 additions and 38 deletions
|
@ -25,11 +25,19 @@ fn test_help() {
|
|||
|
||||
#[test]
|
||||
fn test_short_options() {
|
||||
for option in ["-h", "-v"] {
|
||||
for option in ["-h", "-V"] {
|
||||
new_ucmd!().arg(option).succeeds().stdout_is("");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_conflict() {
|
||||
new_ucmd!()
|
||||
.args(&["--help", "--version"])
|
||||
.succeeds()
|
||||
.stdout_is("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "netbsd"))]
|
||||
fn test_full() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue