feat(builtins): sweep of GNU/BSD compat fixes + str performance opts

Addresses a broad audit of built-in shell utilities against their real counterparts: timeout gains signal delivery, -s/-k/--preserve-status/--foreground/-v, and GNU exit codes; diff defaults to normal format and gains -w/-b/-B/-i/-c/-x/-L/-s/--strip-trailing-cr and proper -r gating; find fixes -newerXY timestamp comparison direction, anchors -regex to whole paths, and gains BSD -perm +mode, -type lists, -size T/P suffixes, -E/-x/-s flags; date gains BSD -r epoch, -v adjustments, -j -f strptime, and non-greedy -I; tail/head accept obsolete -N/+N at any position with any file count; rg resolves case flags by last occurrence and gains --path-separator and clean -0 output; stat prints integer epochs for %X/%Y/%Z and gains BSD -s/-x/-t; cksum is registered as a builtin; truncate implements -o/--io-blocks and b/= size suffixes; sleep/timeout accept infinity; yes/errno/kill accept hyphen-prefixed operands; nohup -- cmd no longer runs --; which gains BSD -s.
This commit is contained in:
can1357
2026-08-20 01:45:28 +02:00
parent 219aae1303
commit edc0caeb0f
51 changed files with 5909 additions and 980 deletions
+2 -1
View File
@@ -3268,6 +3268,7 @@ mod tests {
"base64",
"basename",
"cat",
"cksum",
"cmp",
"combine",
"comm",
@@ -4513,7 +4514,7 @@ mod tests {
.expect("process substitution should not hang");
assert_eq!(result.exit_code, Some(1));
assert!(output.contains("-a\n+b\n"), "diff output missing changed lines: {output:?}");
assert!(output.contains("< a\n---\n> b\n"), "diff output missing changed lines: {output:?}");
}
#[cfg(unix)]