summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2014-12-19 16:08:04 +0000
committerLee Jarvis <ljjarvis@gmail.com>2014-12-19 16:17:19 +0000
commit7cee65ee47c365799bfe0f03217036c1dc0787b2 (patch)
tree7009bb91911333393d24c4dc42838a0ca6061069 /README.md
parent6c509658f8052f1ef9dba8ed5db2207e6375665e (diff)
downloadslop-7cee65ee47c365799bfe0f03217036c1dc0787b2.tar.gz
Add result/parser `arguments` method
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index bf84542..fba08cd 100644
--- a/README.md
+++ b/README.md
@@ -81,6 +81,22 @@ result.to_hash #=> { hostname: "192.168.0.1", port: 80,
puts opts # prints out help
```
+Arguments
+---------
+
+It's common to want to retrieve an array of arguments that were not processed
+by the parser (i.e options or consumed arguments). You can do that with the
+`Result#arguments` method:
+
+```ruby
+args = %w(connect --host google.com GET)
+opts = Slop.parse args do |o|
+ o.string '--host'
+end
+
+p opts.arguments #=> ["connect", "GET"] # also aliased to `args`
+```
+
Arrays
------