summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2014-12-17 08:52:18 +0000
committerLee Jarvis <ljjarvis@gmail.com>2014-12-17 08:52:18 +0000
commitd7f1e3f899f86633bc9d287b39eb56957ca143af (patch)
tree71a009076afa7fc801a017eff3843b70081b8db7 /README.md
parentcc8784b0f57194ee17eaebafbe2a1b4cc2bfe816 (diff)
downloadslop-d7f1e3f899f86633bc9d287b39eb56957ca143af.tar.gz
Add option types to README
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index 50badb9..4666807 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,23 @@ opts.quiet? #=> false
opts.to_hash #=> { host: "192.168.0.1", port: 80, verbose: true, quiet: false }
```
+Option types
+------------
+
+Built in Option types are as follows:
+
+```ruby
+o.string #=> Slop::StringOption, expects an argument
+o.bool #=> Slop::BoolOption, no argument, aliased to BooleanOption
+o.integer #=> Slop::IntegerOption, expects an argument, aliased to IntOption
+o.array #=> Slop::ArrayOption, expects an argument
+o.null #=> Slop::NullOption, no argument and ignored from `to_hash`
+o.on #=> alias for o.null
+```
+
+You can see all built in types in `slop/types.rb`. Suggestions or pull requests
+for more types are welcome.
+
Advanced Usage
--------------