summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
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
------