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

Version Path
ix-cli-0.0.27 bin/ix-pad
ix-cli-0.0.26 bin/ix-pad
ix-cli-0.0.25 bin/ix-pad
ix-cli-0.0.24 bin/ix-pad
ix-cli-0.0.23 bin/ix-pad
ix-cli-0.0.22 bin/ix-pad
ix-cli-0.0.21 bin/ix-pad
ix-cli-0.0.20 bin/ix-pad
ix-cli-0.0.19 bin/ix-pad
ix-cli-0.0.18 bin/ix-pad