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

Parsing parens should not always throw invalid command line string error #54

Open
laurazard opened this issue Dec 22, 2022 · 1 comment

Comments

@laurazard
Copy link

It's not uncommon, in certain scenarios, to use parens inside args.

An example can be seen in the Traefik docs here (click CLI and look at the example), where it's expected that, to set a specific value, the arg --providers.docker.constraints=Label('a.label.name','foo') be used.

With the current implementation of go-shellwords, parsing a string including an arg like that throws an error, even though this is a valid shell-word string.

@ndeloof
Copy link
Contributor

ndeloof commented Dec 23, 2022

By the way, unquoted parentheses doesn't make string an invalid bash command
example:

#> $(which ls)
toto.rb                     bob                      toto.tar                     compose.yml
#> (which ls)
/bin/ls

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

No branches or pull requests

2 participants