Skip to content

Commit 8357431

Browse files
od: fix options after filename issue (#8624)
* od: fix options after filename issue * fix cspell issue
1 parent 2bb097b commit 8357431

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/uu/od/src/od.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ pub fn uu_app() -> Command {
255255
.about(translate!("od-about"))
256256
.override_usage(format_usage(&translate!("od-usage")))
257257
.after_help(translate!("od-after-help"))
258-
.trailing_var_arg(true)
259258
.dont_delimit_trailing_values(true)
260259
.infer_long_args(true)
261260
.args_override_self(true)

tests/by-util/test_od.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55

6-
// spell-checker:ignore abcdefghijklmnopqrstuvwxyz Anone
6+
// spell-checker:ignore abcdefghijklmnopqrstuvwxyz Anone fdbb
77

88
#[cfg(unix)]
99
use std::io::Read;
@@ -975,3 +975,20 @@ fn test_od_invalid_bytes() {
975975
.stderr_only(format!("od: {option} argument '{BIG_SIZE}' too large\n"));
976976
}
977977
}
978+
979+
#[test]
980+
fn test_od_options_after_filename() {
981+
let file = "test";
982+
let (at, mut ucmd) = at_and_ucmd!();
983+
let input: [u8; 4] = [0x68, 0x1c, 0xbb, 0xfd];
984+
at.write_bytes(file, &input);
985+
986+
ucmd.arg(file)
987+
.arg("-v")
988+
.arg("-An")
989+
.arg("-t")
990+
.arg("x2")
991+
.succeeds()
992+
.no_stderr()
993+
.stdout_is(" 1c68 fdbb\n");
994+
}

0 commit comments

Comments
 (0)