Sha256: d1c1bd34722f690e86e8c4464f37b33300c4cf13e622baa31a8382160f64dfd8
Contents?: true
Size: 603 Bytes
Versions: 10
Compression:
Stored size: 603 Bytes
Contents
#!/usr/bin/env ruby require 'optparse' options = {} options[:size] = 2 OptionParser.new do |opts| opts.banner = "Usage: #{$0} [OPTIONS]" opts.on('-s', '--size [NUMBER]', 'Size.') do |value| options[:size] = value.to_i end end.parse! required_options = [:size] required_options.each do |option| unless options[option] $stderr.puts "Can not run #{option.to_s} was not given." exit 1 end end options[:size].times do |i| puts '' end STDIN.each_line do |line| puts (' ' * options[:size]) + line.chomp + (' ' * options[:size]) end options[:size].times do |i| puts '' end
Version data entries
10 entries across 10 versions & 1 rubygems