lib/clickatell/utility/options.rb in clickatell-0.6.0 vs lib/clickatell/utility/options.rb in clickatell-0.7.0
- old
+ new
@@ -7,11 +7,12 @@
class << self
def parse(args)
@options = self.default_options
parser = OptionParser.new do |opts|
- opts.banner = "Usage: sms [options] recipient message"
+ opts.banner = "Usage: sms [options] recipient(s) message"
+ opts.separator " Recipients can be a comma-separated list, up to 100 max."
opts.separator ""
opts.separator "Specific options:"
opts.on('-u', '--username USERNAME',
"Specify the clickatell username (overrides ~/.clickatell setting)") do |username|
@@ -71,9 +72,11 @@
if (@options.message.nil? || @options.recipient.nil?) && send_message?
puts "You must specify a recipient and message!"
puts parser
exit
end
+
+ @options.recipient = @options.recipient.split(",")
return @options
rescue OptionParser::MissingArgument => e
switch_given = e.message.split(':').last.strip