Skip to content

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

Description

@mmuurr
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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions