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

The CommandLineUtils.translateCommandline fails to parse inner qoutes #33

Open
KIC opened this issue Jan 22, 2018 · 0 comments
Open

The CommandLineUtils.translateCommandline fails to parse inner qoutes #33

KIC opened this issue Jan 22, 2018 · 0 comments

Comments

@KIC
Copy link

KIC commented Jan 22, 2018

Here is a small failing test case using spock:

import org.codehaus.plexus.util.cli.CommandLineUtils
import spock.lang.Specification

class CommandlineCommandTest extends Specification {

    def "test getCommand"() {
        given:
        def command = CommandLineUtils.translateCommandline('exec -s something -e "lala \"lo lo\" lulu" -f $file')

        when:
        def parts = command

        then:
        parts.each {println(it)}
        parts == ["exec", "-s", "something", "-e", "lala \"lo lo\" lulu", "-f", "the.file"]
    }

}

it prints

exec
-s
something
-e
lala lo
lo lulu
-f
$file

while we expect lala "lo lo" lulu to be one string

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

1 participant