Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore escaped delimiters #1148

Merged
merged 3 commits into from
Jul 26, 2024
Merged

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Jul 26, 2024

Ignore escaped delimiters when splitting input string for flags with delimiter and multiple

Before

my-cli --flag one,two,three` => {flag: ['one', 'two', 'three']}

After

my-cli --flag one\,two,three` => {flag: ['one,two', 'three']}

This is useful when you have flag values that contain the delimiter but shouldn't be split.

Depending on you shell, you might need to double escape to get the desired effect.

@W-16343745@
forcedotcom/cli#2928

@mshanemc
Copy link
Member

QA: threw extra UT at it, all ✅

the breaking scenario would be "I'm already using multiple and delimiter: ',' AND I have the escape character like \, or \\, being used by my command and that's currently being interpreted as a delimiter and now it's about to not be.

seems pretty low-probability.

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.

2 participants