docopt.go icon indicating copy to clipboard operation
docopt.go copied to clipboard

Show example of repeatable flag

Open mcandre opened this issue 8 years ago • 1 comments

Does docopt support repeating flags, like hello -e name:bob -e hair:nil? If so, could the README please add an example of the docopt string syntax for enabling this for one or more named flags?

mcandre avatar Mar 14 '17 03:03 mcandre

Any data type other than the built-in getters e.g. opts.Bool() can be accessed like a normal map object.

// needs type assertion to convert the type correctly
repeatedValues,_ := opts["--map"].([]string)

eirannejad avatar Mar 20 '19 19:03 eirannejad