GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — cmp - usage errors lack GNU's wording, `cmp:` prefix and "Try --help" line · Issue #347 · uutils/diffutils Open Labels gnu-compatBehaviour differs from GNUBehaviour differs from GNUgood first issueGood for newcomersGood for newcomersoss-scannerFound by Anthropic's OSS ScannerFound by Anthropic's OSS Scanner DescriptionKnown: #177 (open issue) — #177 For command-line usage errors GNU Reproductionprintf 'abcdefghij' > c1; printf 'abcdeXghiY' > c2 Rust (incorrect) $ ./target/release/diffutils cmp Usage: cmp <from> <to> # Exit code: 2 $ ./target/release/diffutils cmp --bogus c1 c2 unrecognized option '--bogus' # Exit code: 2 $ ./target/release/diffutils cmp c1 c2 3 4 extra Usage: cmp <from> <to> # Exit code: 2 GNU (correct) $ LC_ALL=C cmp cmp: missing operand after 'cmp' cmp: Try 'cmp --help' for more information. # Exit code: 2 $ LC_ALL=C cmp --bogus c1 c2 cmp: unrecognized option '--bogus' cmp: Try 'cmp --help' for more information. # Exit code: 2 $ LC_ALL=C cmp c1 c2 3 4 extra cmp: extra operand 'extra' cmp: Try 'cmp --help' for more information. # Exit code: 2
Root cause
fn usage_string(executable: &str) -> String { format!("Usage: {executable} <from> <to>") } ... return Err(format!("unrecognized option '{}'", param.to_string_lossy())); TestAdd to #[test] fn cmp_usage_errors_match_gnu() -> Result<(), Box<dyn std::error::Error>> { let mut cmd = cargo_bin_cmd!("diffutils"); cmd.arg("cmp"); cmd.assert().code(predicate::eq(2)).stderr(predicate::eq( "cmp: missing operand after 'cmp'\ncmp: Try 'cmp --help' for more information.\n", )); let mut cmd = cargo_bin_cmd!("diffutils"); cmd.arg("cmp").arg("--bogus").arg("a").arg("b"); cmd.assert().code(predicate::eq(2)).stderr(predicate::eq( "cmp: unrecognized option '--bogus'\ncmp: Try 'cmp --help' for more information.\n", )); Ok(()) } Reported by Anthropic's OSS Scanner (ANT-2026-VNGOYIV8). Activity
MetadataMetadataAssigneesLabelsgnu-compatBehaviour differs from GNUBehaviour differs from GNUgood first issueGood for newcomersGood for newcomersoss-scannerFound by Anthropic's OSS ScannerFound by Anthropic's OSS Scanner TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |