39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'Library/Homebrew/cask/lib/hbc/cli/options.rb', line 39
def process_arguments(*arguments)
parser = OptionParser.new do |opts|
next if self.class.options.nil?
self.class.options.each do |option_name, option_method|
option_type = case option_name.split(/(\ |\=)/).last
when "PATH"
Pathname
when /\w+(,\w+)+/
Array
end
opts.on(option_name, *option_type) do |value|
if option_method.respond_to?(:call)
option_method.call(value)
else
send(:"#{option_method}=", value)
end
end
end
end
parser.parse(*arguments)
end
|