From d3fbc051bdd68d199cf3350a5bc50206c18a9f0c Mon Sep 17 00:00:00 2001 From: Rikuoh Date: Sun, 21 Jul 2024 09:50:07 +0900 Subject: [PATCH] wc --- wc.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wc.rb b/wc.rb index 21bde5f..afd18d6 100644 --- a/wc.rb +++ b/wc.rb @@ -10,7 +10,8 @@ def parse_options opts.on('-c') { options[:bytes] = true } end.parse! options = { bytes: true, lines: true, words: true } if options.empty? - [options, ARGV.empty? ? ['-'] : ARGV] + sources = ARGV.empty? ? ['-'] : ARGV + [options, sources] end def input_stream_sources(input_sources, options)