docopt/docopt.R

Better documentation for positional parameter info

Opened this issue · 0 comments

Since the current implementation supports also info for positional parameters (and even arbitrary text, which is really useful), it would be great if the examples in the README or via ?docopt could mention this as well.


suppressMessages(require(docopt))

doc <- '
Analyze the effect of the batch removal on the clustering
Usage: batch_effect_removal.R [options] <count_matrix> <fancy_input>

Inputs:
count_matrix                    The input data
fancy_input                      Another very important input for this cool program

Options:
--contrasts=<tab_delim_table>   Table with sample pairs for which dge analysis should be performed
--pcutoff <pcutoff>             Override q-value filter and filter by p-value instead
'

#valid
opts <- docopt(doc, args=list("foo.txt"))
#invalid
opts <- docopt(doc, args=list())

# do wee see the Inputs when asking for help?
opts <- docopt(doc, args="--help")

See the "Inputs" and header line in the example.