go-shellwords
go-shellwords copied to clipboard
Parsing parens should not always throw `invalid command line string` error
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.
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