summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index 77045a4..f6de678 100644
--- a/README.md
+++ b/README.md
@@ -101,6 +101,21 @@ end
p opts.arguments #=> ["connect", "GET"] # also aliased to `args`
```
+This is particularly useful when writing scripts with `ARGF`:
+
+```ruby
+opts = Slop.parse do |blah|
+ # ...
+end
+
+# make sure sloptions aren't consumed by ARGF
+ARGV.replace opts.arguments
+
+ARGF.each { |line|
+ # ...
+}
+```
+
Arrays
------