mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
Change -l to conflict with -n and -c
This commit is contained in:
1 parent
c497c1fac9
commit
7da04c6bff
2 files changed
+25
No files matched your search
@@ -61,6 +61,7 @@ fn run() -> Result<(), AnyhowError> {
|
||||
.short("l")
|
||||
.takes_value(true)
|
||||
.value_name("N")
|
||||
.conflicts_with_all(&["length", "bytes"])
|
||||
.hidden(true)
|
||||
.help("Yet another alias for -n/--length"),
|
||||
)
|
||||
|
||||
@@ -85,6 +85,30 @@ mod length {
|
||||
.assert()
|
||||
.failure();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fail_if_length_and_count_options_are_used_simultaneously() {
|
||||
hexyl()
|
||||
.arg("hello_world_elf64")
|
||||
.arg("--length=32")
|
||||
.arg("-l=10")
|
||||
.assert()
|
||||
.failure();
|
||||
}
|
||||
}
|
||||
|
||||
mod bytes {
|
||||
use super::hexyl;
|
||||
|
||||
#[test]
|
||||
fn fail_if_bytes_and_count_options_are_used_simultaneously() {
|
||||
hexyl()
|
||||
.arg("hello_world_elf64")
|
||||
.arg("--bytes=32")
|
||||
.arg("-l=10")
|
||||
.assert()
|
||||
.failure();
|
||||
}
|
||||
}
|
||||
|
||||
mod skip {
|
||||
|
||||
Reference in new issue
Block a user