od: fix options after filename issue (#8624)

* od: fix options after filename issue

* fix cspell issue
This commit is contained in:
Alen Antony
2025-09-12 17:37:13 +02:00
committed by GitHub
parent 2bb097ba7b
commit 83574316e7
2 changed files with 18 additions and 2 deletions
-1
View File
@@ -255,7 +255,6 @@ pub fn uu_app() -> Command {
.about(translate!("od-about"))
.override_usage(format_usage(&translate!("od-usage")))
.after_help(translate!("od-after-help"))
.trailing_var_arg(true)
.dont_delimit_trailing_values(true)
.infer_long_args(true)
.args_override_self(true)
+18 -1
View File
@@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore abcdefghijklmnopqrstuvwxyz Anone
// spell-checker:ignore abcdefghijklmnopqrstuvwxyz Anone fdbb
#[cfg(unix)]
use std::io::Read;
@@ -975,3 +975,20 @@ fn test_od_invalid_bytes() {
.stderr_only(format!("od: {option} argument '{BIG_SIZE}' too large\n"));
}
}
#[test]
fn test_od_options_after_filename() {
let file = "test";
let (at, mut ucmd) = at_and_ucmd!();
let input: [u8; 4] = [0x68, 0x1c, 0xbb, 0xfd];
at.write_bytes(file, &input);
ucmd.arg(file)
.arg("-v")
.arg("-An")
.arg("-t")
.arg("x2")
.succeeds()
.no_stderr()
.stdout_is(" 1c68 fdbb\n");
}