My urfave/cli version is
v3.3.8
Checklist
Describe the bug
Strings arguments to a StringSliceFlag are always trimmed regardless of the TrimSpace configuration
To reproduce
// See flag_test.go
// Existing test
{
name: "StringSliceFlag valid with TrimSpace",
input: "foo , bar ",
output: []string{"foo", "bar"},
fl: &StringSliceFlag{Name: "names", Sources: EnvVars("NAMES"), Config: StringConfig{TrimSpace: true}},
},
// Add a new test with TrimSpace set to false
{
name: "StringSliceFlag valid without TrimSpace",
input: "foo , bar ",
output: []string{"foo ", " bar "},
fl: &StringSliceFlag{Name: "names", Sources: EnvVars("NAMES"), Config: StringConfig{TrimSpace: false}},
},
Observed behavior
Spaces are trimmed regardless:
Expected behavior
I expected it to preserve spaces with TrimSpace set to false
[]string{"foo ", " bar "}
My urfave/cli version is
v3.3.8
Checklist
Describe the bug
Strings arguments to a StringSliceFlag are always trimmed regardless of the
TrimSpaceconfigurationTo reproduce
Observed behavior
Spaces are trimmed regardless:
Expected behavior
I expected it to preserve spaces with
TrimSpaceset to false