#! /usr/bin/env ruby def main() if (ARGV.length == 0) word = STDIN.gets.chomp else word = ARGV[0] end if word =~ /\d/ STDERR.puts "wrong word!" exit 1 else puts word + "s" end end main