summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorRick Hull <rick.hull@gmail.com>2015-06-23 19:52:40 -0700
committerRick Hull <rick.hull@gmail.com>2015-06-23 19:53:54 -0700
commit659d6fcaf343b65dd3208b3f6dedf447a5733852 (patch)
tree3a604f9f3f1dcf515fabb6a85891ae2c7339b6fa /README.md
parentb197bf93641525f84ef11417002d283f3f1702f7 (diff)
downloadslop-659d6fcaf343b65dd3208b3f6dedf447a5733852.tar.gz
add ARGF notes to Arguments
ci skip
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
------