Skip to content

cut: keep leading '=' in short option values - #16910

Open
asxxb wants to merge 1 commit into
uutils:mainfrom
asxxb:fix-cut-equals-short-option
Open

asxxb wants to merge 1 commit into
uutils:mainfrom
asxxb:fix-cut-equals-short-option

Conversation

@asxxb

@asxxb asxxb commented Nov 27, 2026

Copy link
Copy Markdown

Closes #16436

Clap strips the first = after a short option (treating -b=1 as -b 1), whereas GNU cut treats everything after the short option letter—including a leading =—as its value. Previously only -d= was special-cased, so -b=, -c=, -f=, -F=, -O=, and -d=x dropped the =.

This replaces the -d= special case with preserve_short_option_equals, which doubles the leading = after value-taking short options (-b, -c, -d, -f, -F, -O), including when clustered after flags, while leaving -w=, detached option values, and arguments after -- untouched. Added unit and integration tests covering these cases.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/env/env is no longer failing!

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.

cut: the '=' after a short option is dropped from its value

1 participant