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 Process.parse_argument behavior against a quote in a word #10337

Merged

Conversation

makenowjust
Copy link
Contributor

@makenowjust makenowjust commented Jan 30, 2021

Fixed #10306
Thanks, @erdnaxeli for reporting.

It fixes the condition to an end of a bare word on a quote character.

Now, it works as we expected.

require "process"

pp ARGV
pp Process.parse_arguments(%(this 'is a "'very wei"rd co"m"mand please" don't do t'h'a't p"leas"e))
$ bin/crystal run a.cr -- this 'is a "'very wei"rd co"m"mand please" don't do t'h'a't p"leas"e
["this", "is a \"very", "weird command please", "dont do that", "please"]
["this", "is a \"very", "weird command please", "dont do that", "please"]

@erdnaxeli
Copy link
Contributor

Too bad it wasn't merged for 0.36.1. I guess I will keep my lib for now :)

@makenowjust
Copy link
Contributor Author

ping.

@bcardiff bcardiff added this to the 1.0.0 milestone Feb 12, 2021
@bcardiff bcardiff merged commit b342366 into crystal-lang:master Feb 12, 2021
@makenowjust makenowjust deleted the fix-10306-parse-argument-quote branch February 12, 2021 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Process.parse_arguments escapes quotes when it should not
4 participants