mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #2551 from uutils/od-hang
od: fix reading from file while supplying a format argument
This commit is contained in:
@@ -435,6 +435,7 @@ pub fn uu_app() -> clap::App<'static, 'static> {
|
||||
.long(options::FORMAT)
|
||||
.help("select output format or formats")
|
||||
.multiple(true)
|
||||
.number_of_values(1)
|
||||
.value_name("TYPE"),
|
||||
)
|
||||
.arg(
|
||||
|
||||
@@ -46,6 +46,17 @@ fn test_file() {
|
||||
.succeeds()
|
||||
.no_stderr()
|
||||
.stdout_is(unindent(ALPHA_OUT));
|
||||
|
||||
// Ensure that default format matches `-t o2`, and that `-t` does not absorb file argument
|
||||
new_ucmd!()
|
||||
.arg("--endian=little")
|
||||
.arg("-t")
|
||||
.arg("o2")
|
||||
.arg(file.as_os_str())
|
||||
.succeeds()
|
||||
.no_stderr()
|
||||
.stdout_is(unindent(ALPHA_OUT));
|
||||
|
||||
let _ = remove_file(file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user