docopt / docopt.go

A command-line arguments parser that will make you smile.
http://docopt.org/
MIT License
1.43k stars 111 forks source link

Array values duplicated with OneOrMore options (...) #77

Open ps78674 opened 3 years ago

ps78674 commented 3 years ago

The following usage

Usage:
  %[1]s [-u <URL>...] (-D <DOMAINFILE> [-V <VOLUMEFILE> -p <STORAGEPOOL> --start])
  %[1]s [-u <URL>...] (-V <VOLUMEFILE> [-p <STORAGEPOOL>])
  %[1]s [-u <URL>...] (--domdata <DOMAINDATA> [--voldata <VOLUMEDATA> -p <STORAGEPOOL>] --start)
  %[1]s [-u <URL>...] (--voldata <VOLUMEDATA> [-p <STORAGEPOOL>])
  %[1]s [-u <URL>...] (-R <DOMAINNAME>)

Options:
  -u, --url <URL>            server url [default: qemu:///system]
*******

with cli opts -u qemu+ssh://user@hostname/system -u test produces array with duplicated 2-nd value: [qemu+ssh://user@hostname/system test test test test test]

Sylvain303 commented 2 years ago

Hello, very interesting. Could you explain what introduced the duplication? I suppose it's related to multiple line of usage linked with the options definition.

Very nice catch. I also tested on line

Docopt online

Bug here too.