summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2015-06-25 08:40:59 +0100
committerLee Jarvis <ljjarvis@gmail.com>2015-06-25 08:40:59 +0100
commit045f807670ef3d8caead25b36d7f5de5ef2374cf (patch)
tree3a604f9f3f1dcf515fabb6a85891ae2c7339b6fa
parentb197bf93641525f84ef11417002d283f3f1702f7 (diff)
parent659d6fcaf343b65dd3208b3f6dedf447a5733852 (diff)
downloadslop-045f807670ef3d8caead25b36d7f5de5ef2374cf.tar.gz
Merge pull request #173 from rickhull/master
add ARGF notes to Arguments
-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
------