Skip to content

Commit

Permalink
accept map[string]string as flag
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Mar 21, 2022
1 parent 2cbc0a5 commit 84cb465
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ func flagsToRequest(flags map[string][]string, req *registry.Value) (map[string]
return ret, nil
case "string":
return value[0], nil
case "map[string]string":
var val map[string]string
if err := json.Unmarshal([]byte(value[0]), &val); err != nil {
return value[0], nil
}
return val, nil
default:
return value, nil
}
Expand Down

0 comments on commit 84cb465

Please sign in to comment.