39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/efreesms/bin.rb', line 39
def parse_opts
OptionParser.new {|opts|
opts.banner = "Usage: #$0 [options] phone"
opts.on('-e', '--editor EDITOR', 'Select editor') {|ed|
@editor = ed
}
opts.on('-c', '--country COUNTRY', 'Select recipients\' country') {|c|
@country = c
}
opts.on('-u', '--user USER', 'Select your name in sms') {|u|
@user = u
}
opts.on_tail('-v', '--version', 'Show version') {
puts "e-freesms sender #{EFreeSMS::VERSION}"
exit 0
}
}.tap {|opts|
o = opts.parse!(ARGV)
if o.size != 1
$stderr.puts opts
exit 1
end
@number = o.first
@user ||= ENV['USER']
}
end
|