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

Quotes within arguments are removed #72

Open
Effervex opened this issue Feb 14, 2022 · 2 comments
Open

Quotes within arguments are removed #72

Effervex opened this issue Feb 14, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Effervex
Copy link

Introduced in 1.7.2, when using TAP to parse arguments, arguments with quotes within the argument remove the quote. This was likely introduced when handling quoted arguments. It appears to be the same for either quote style.

For instance:
--foo b'a'r
is parsed as:
foo: 'bar'

It works fine if the argument is quoted though, so perhaps this is not an issue:
--foo "b'a'r"
is parsed as:
foo: 'b\'a\'r'

@martinjm97 martinjm97 added the bug Something isn't working label Mar 28, 2022
@martinjm97
Copy link
Collaborator

Hi @Effervex,

Great point! We agree this is an issue. We should check if a string is enclosed in quotation marks before remove quotation marks. As you might have guessed from the lag in the reply, it might take a while. PRs appreciated... we'll try to get to it soon!

Thanks,
Kyle and Jesse

@arnaud-ma
Copy link
Contributor

This seems to be an expected case for any shell. For example on bash:

>>> echo b'a'r
bar
>>> echo "b'a'r"
b'a'r
>>> echo b\'a\'r
b'a'r

The only solution is unfortunately to use "b'a'r" or b\'a\'r. And it's the same for any other command from any other tool, because the parsing is done at the shell level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants