Skip to content

Add Parser::parse_short_equals() setting for disabling -o=value#24

Open
blyxxyz wants to merge 1 commit intomasterfrom
parse_short_eq
Open

Add Parser::parse_short_equals() setting for disabling -o=value#24
blyxxyz wants to merge 1 commit intomasterfrom
parse_short_eq

Conversation

@blyxxyz
Copy link
Owner

@blyxxyz blyxxyz commented Jul 24, 2025

Since v0.2.0 -o=value has been parsed as option -o with value value. This is nonstandard but compatible with clap.

This PR adds a parse_short_equals(bool) method to configure this. If disabled the equals sign is treated as part of the value, i.e. -o with value =value.

This is for example useful for cut's -d option, which is often invoked as cut -d=. That makes it relevant for https://github.com/uutils/uutils-args.

Resolves #13.

cc @tertsdiepraam

@Mango0x45
Copy link

Any chance this PR will get merged eventually? For what it’s worth, I am still using this crate actively on v0.1.0 for my projects, as = is very often a valid value in my software

@blyxxyz
Copy link
Owner Author

blyxxyz commented Feb 24, 2026

Thanks for reminding me, I'll merge this soon. I'm only debating whether to call it parse_short_equals or rename it to set_short_equals.

Is = theoretically valid in your programs or commonly used? I'd love to have examples besides cut -d=.

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.

Please provide way to parse -o=value as option taking value =value

2 participants