l0c4lh057
l0c4lh057

Reputation: 41

Use parameter mutliple time but with limit in docopt

I want to format my command usage with docopt.

I found out that

<parameter>...

means that you can write a parameter multiple time. My problem is, that I have an argument that you can repeat multiple times but it has a limit. I don't want to write

<parameter> [<parameter> <parameter> <parameter> <parameter> <parameter> <parameter>]

with the correct count of the

<parameter>

tag. Is there a shorter way to specify that you can use the parameter mutliple times but the maximum is 15 times?

Upvotes: 2

Views: 27

Answers (1)

Liad
Liad

Reputation: 339

Short answer: No, you can't specify a maximum number of occurrences of a pattern in docopt. You can only specify a minimum. You will have to deal with that afterwards (or write X time).

Upvotes: 2

Related Questions