Skip to content

Parameter / flag parsing from YAML does not remove quotes around quoted arguments #172

@juliusv

Description

@juliusv

The parameter parsing code at

promu/util/sh/sh.go

Lines 46 to 50 in 0455049

// SplitParameters splits shell command parameters, taking quoting in account.
func SplitParameters(s string) []string {
r := regexp.MustCompile(`'[^']*'|[^ ]+`)
return r.FindAllString(s, -1)
}
allows extracting quoted arguments (to allow such things as -tags 'foo bar'), but it does not remove the quotes around quoted arguments before passing this to the execution layer. Thus, quoted arguments aren't currently working correctly.

I wonder overall whether we should try to parse this as one line or go the "normal" way of just having a YAML list of command-line arguments with no postprocessing needed after YAML parsing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions