diff --git a/flags.go b/flags.go index a6acf1b..6e2c8f0 100644 --- a/flags.go +++ b/flags.go @@ -66,6 +66,15 @@ line, you specify the value for such an option as key:value. For example Then, the AuthorInfo map can be filled with something like -a name:Jesse -a "surname:van den Kieboom". +You can also specify key-value-delimiter. + + type Options struct { + AuthorInfo string[string] `short:"a" key-value-delimiter:"="` + } + +In this case, the AuthorInfo map can be filled with something like +-a name=Jesse -a "surname=van den Kieboom". + Finally, for full control over the conversion between command line argument values and options, user defined types can choose to implement the Marshaler and Unmarshaler interfaces. @@ -111,6 +120,10 @@ The following is a list of tags for struct fields supported by go-flags: e.g. `long:"animal" choice:"cat" choice:"dog"` hidden: if non-empty, the option is not visible in the help or man page. + key-value-delimiter: when specified on a map field, the key and the value are + separated with the given delimiter string, + instead of the default delimiter ":" (optional) + base: a base (radix) used to convert strings to integer values, the default base is 10 (i.e. decimal) (optional)