Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leading [options] doesn't match reference implementation #48

Open
mmuurr opened this issue Aug 18, 2021 · 0 comments
Open

leading [options] doesn't match reference implementation #48

mmuurr opened this issue Aug 18, 2021 · 0 comments

Comments

@mmuurr
Copy link

mmuurr commented Aug 18, 2021

doc <- "
My Program

Usage:
  progname [options] doit --reqarg <arg1>

Options:
  --opt1 <val>
"

The reference implementation supports leading options, as described in the above docopt doc.
The R implementation errs:

docopt::docopt(doc, c("doit", "--reqarg", "arg1val"), strict = TRUE)  ## errs, but shouldn't

Moving [options] to the end fixes this, but there are lots of good use cases where users are encouraged to specify 'global' options prior to the subcommands (e.g. optional args like, --env prod).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant