Skip to content

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

@mmuurr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions