OK, Thank you for your suggestion.
I would like replace my program last 3 lines by:
key, size = ARGV.slice!(ARGV.index('-s'), 2) if ARGV.include?('-s')
if ARGV.empty? || /^\d+$/ !~ ARGV.first
puts "Usage: #$0 [-s size] number"
else
LCD.new(ARGV.first, size).each_line { |line| puts line }
end
I think it should be better in this way.
Enjoy!