-
Notifications
You must be signed in to change notification settings - Fork 556
Closed
Description
Hello, I'd like to use docopt for rather complicated flags.
For a package manager I'd like to provide an interface that follows the following EBNF:
flags ::= ( '--git' 'URL' ( '--branch' 'BRANCH' | '--tag' 'TAG' | '--rev' 'REV' )? | '--path' 'PATH' | 'CRATE' ( '--vers' 'VERSION' )? )+I tried to achieve this with the following docopt pattern:
Usage:
prog (--git=URL [--branch=BRANCH | --tag=TAG | --rev=REV] | --path=PATH | CRATE [--version=VERSION])...
Executing this with the parameters crate1 --version=foo crate2 --git url1 --tag release --git url2 --branch develop yields the following:
{"--branch": ["develop"],
"--git": ["url1","'url2"],
"--path": [],
"--rev": [],
"--tag": ["release"],
"--version": ["foo"],
"CRATE": ["crate1", "crate2"]}My problem is that I want to keep the branch, tag or rev flag together with the giturl as well as the version together with crate.
Otherwise I don't know which tag belongs to which giturl and which version to which crate.
Can someone give me a heads up on this one?
Thank you in advance!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
