Skip to content

Commit

Permalink
better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Speller authored and Alex Speller committed Jun 5, 2012
1 parent 5615e8d commit b52197c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,21 @@ end
Hell yeah! The option parser is generated based on `doc` string above, that you
pass to the `Docopt` function.

API `require 'docopt'`
===============================================================================
```ruby
require 'docopt'
doc = "Usage: your_program.rb [options]
-h --help Show this.
-v --verbose Print more text.
--quiet Print less text.
-o FILE Specify output file [default: ./test.txt]"

options = Docopt(doc, version=nil, help=true)`
options['--help'] # returns true or false depending on option given
```

###`options = Docopt(doc, version=nil, help=true)`

`Docopt` takes 1 required and 2 optional arguments:

Expand Down

0 comments on commit b52197c

Please sign in to comment.