Skip to content

od: reject type options when --strings is given - #16023

Open
Logic769 wants to merge 3 commits into
uutils:mainfrom
Logic769:od-strings-type-conflict
Open

Logic769 wants to merge 3 commits into
uutils:mainfrom
Logic769:od-strings-type-conflict

Conversation

@Logic769

Copy link
Copy Markdown
Contributor

Problem

od --strings=1 -c a.txt prints strings and exits 0, whereas GNU od rejects a type option together with --strings:

od: no type may be specified when dumping strings
(exit code 1)

The same happens with -b, -d, -i, -l, -o, -s, -x, -t and the other traditional format flags.

Change

Add has_type_option() in parse_formats (mirrors parse_format_flags) and reject the combination when --strings is given, with exit code 1 and the GNU message.

Tests

Added test_strings_with_type_option_is_error in tests/by-util/test_od.rs.

Closes #15989

@RenjiSann
RenjiSann force-pushed the od-strings-type-conflict branch from 413efdb to d5e22c4 Compare October 30, 2026 10:36
@Logic769
Logic769 force-pushed the od-strings-type-conflict branch 2 times, most recently from 109b848 to 5f25921 Compare November 1, 2026 14:41
Comment thread src/uu/od/locales/en-US.ftl Resolved
@sylvestre

Copy link
Copy Markdown
Contributor

a bunch of jobs are failing

@Logic769
Logic769 force-pushed the od-strings-type-conflict branch from 5f25921 to 164e1d8 Compare November 2, 2026 01:02
Comment thread src/uu/od/src/parse_formats.rs Resolved
Comment thread src/uu/od/src/parse_formats.rs Resolved
Comment thread tests/by-util/test_od.rs Resolved
@Logic769
Logic769 force-pushed the od-strings-type-conflict branch from 2d631d2 to 2d93634 Compare November 3, 2026 15:43
@Logic769
Logic769 force-pushed the od-strings-type-conflict branch from 2d93634 to 31e10e2 Compare November 3, 2026 15:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

od: --strings combined with a type option should be an error

3 participants