Skip to content

Discrepancy between argfile and shell when processing escaped characters #628

@utikeev

Description

@utikeev

Let's say I have the following command that simply prints the passed multiple arguments.

class Hello : CliktCommand() {
    val words by argument().multiple()

    override fun run() {
        println(words)
    }
}

Calling ./hello a b "'"c"'" in sh, bash, zsh correctly produces [a, b, 'c'] as the output.

However, if I put the exact same arguments inside the argfile:

a b "'"c"'"

calling ./hello @argfile produces [a, b, ', c'] separating the first quote into a separate argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions