Skip to content

docopt.R mixes options and arguments #46

@antonkulaga

Description

@antonkulaga

I have the following program:

doc <- 'Usage:
  translate.R [--wd <wd>][--suffix <suffix>] <dbs> ...

  Options:   
   -w --wd <wd> [default: FALSE]
   -s --suffix <suffix> [default: translated].
   -h --help     Show this screen.'

when I call:

    args <- c('_with_translation''/data/samples/AIRR-Seq/ramos/test/merged/heavy.tsv''/data/samples/AIRR-Seq/ramos/test/merged/light.tsv'
docopt(doc, args = args, version="0.1")
)

sometimes it works, sometimes "_with_translation" becomes part of dbs. However, when I want to popular --wd argument all the order is messed up and TRUE goes to suffix while '_with_translation' becomes part of

    args <- c(TRUE, '_with_translation''/data/samples/AIRR-Seq/ramos/test/merged/heavy.tsv''/data/samples/AIRR-Seq/ramos/test/merged/light.tsv'
docopt(doc, args = args, version="0.1")

It would be nice if you would fix this bug and also provide a clear way (or clear explanations in the docs) how I can pass options in docopt together with multiple arguments in a safe and reliable way.

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