aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-09-16 11:45:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-09-17 22:05:58 +0900
commit72772a3caa16fd240aa1e9c9432e2d6492c0b0ac (patch)
tree43429aea7910f3193a15a1a4484b018ce63ee49a /io.c
parent2dffd365048d48e4d8da8bd77a023f87d7266e9f (diff)
downloadruby-72772a3caa16fd240aa1e9c9432e2d6492c0b0ac.tar.gz
[DOC] Mention "-" in ARGF
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/io.c b/io.c
index 480bed9157..712dce3ceb 100644
--- a/io.c
+++ b/io.c
@@ -14625,11 +14625,16 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* ARGV.replace ["file2", "file3"]
* ARGF.read # Returns the contents of file2 and file3
*
- * If +ARGV+ is empty, ARGF acts as if it contained STDIN, i.e. the data
- * piped to your script. For example:
+ * If +ARGV+ is empty, ARGF acts as if it contained <tt>"-"</tt> that
+ * makes ARGF read from STDIN, i.e. the data piped or typed to your
+ * script. For example:
*
* $ echo "glark" | ruby -e 'p ARGF.read'
* "glark\n"
+ *
+ * $ echo Glark > file1
+ * $ echo "glark" | ruby -e 'p ARGF.read' -- - file1
+ * "glark\nGlark\n"
*/
/*