This commit is contained in:
Rikuoh Tsujitani 2024-07-21 09:50:07 +09:00
parent 0243e260b9
commit d3fbc051bd
Signed by: riq0h
GPG key ID: 010F09DEA298C717

3
wc.rb
View file

@ -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)