Add the Ruby gem to readme file.
This commit is contained in:
parent
31d5a53d3a
commit
fec6adcaf3
|
@ -37,10 +37,14 @@ The above comments work both as source code documentation and as help text, as w
|
||||||
|
|
||||||
### For Ruby
|
### For Ruby
|
||||||
|
|
||||||
|
```
|
||||||
|
gem install easyoptions
|
||||||
|
```
|
||||||
|
|
||||||
After writing your documentation, you simply require this script. Then all command line options will get parsed into the `$options` hash, as described above. You can then check their values for reacting to them. All regular arguments will get stored into the `$arguments` array. Here is an example for parsing the comments above:
|
After writing your documentation, you simply require this script. Then all command line options will get parsed into the `$options` hash, as described above. You can then check their values for reacting to them. All regular arguments will get stored into the `$arguments` array. Here is an example for parsing the comments above:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
require_relative "easyoptions"
|
require "easyoptions"
|
||||||
|
|
||||||
# Boolean options
|
# Boolean options
|
||||||
puts "Option specified: --some-option" if $options[:some_option]
|
puts "Option specified: --some-option" if $options[:some_option]
|
||||||
|
|
Loading…
Reference in New Issue