docopt/docopt.R

oddly-formatted usage message

Closed this issue · 1 comments

A file with the following interface

docs <- list()
"
Usage:

    build profile [--previous=<num>] [--time=<time>]
    build redocument
" -> docs $ master

called with

Rscript myfile.R

Raises a usage error, as no arguments were provided to the interface. This is fine, but the output is hard to read as it is presented on one line:

Error in docopt(docs$master) : 
  usage: build profile [--previous=<num>] [--time=<time>]usage: build redocument
Calls: main -> docopt
Execution halted

This example is not too bad, but my actual use case had ~10 different usage sections and was pretty difficult to read. Could you add new-line delimiters between each usage section, so the user can more easily see the correct interface?

Error in docopt(docs$master) : 
  usage: build profile [--previous=<num>] [--time=<time>]
  usage: build redocument
Calls: main -> docopt
Execution halted

I didn't find the code responsible for this behaviour, but I imagine it is within printable_usage.

Thanks for reporting! Should be fixed in latest version (of github)