add support to make map separator configurable
This commit is contained in:
committed by
Alec Thomas
parent
ca3a30c5f1
commit
529703d8d1
@@ -161,6 +161,16 @@ func TestMapWithMultipleValues(t *testing.T) {
|
||||
require.Equal(t, map[string]string{"a": "b", "c": "d"}, cli.Value)
|
||||
}
|
||||
|
||||
func TestMapWithDifferentSeparator(t *testing.T) {
|
||||
var cli struct {
|
||||
Value map[string]string `mapsep:","`
|
||||
}
|
||||
k := mustNew(t, &cli)
|
||||
_, err := k.Parse([]string{"--value=a=b,c=d"})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, map[string]string{"a": "b", "c": "d"}, cli.Value)
|
||||
}
|
||||
|
||||
func TestURLMapper(t *testing.T) {
|
||||
var cli struct {
|
||||
URL *url.URL `arg:""`
|
||||
|
||||
Reference in New Issue
Block a user