This method is only available on newer versions.
The first available version (v2_6_3) is shown here.
to_switches(options)
public
Receives a hash and makes it switches.
# File lib/bundler/vendor/thor/lib/thor/parser/options.rb, line 11
def self.to_switches(options)
options.map do |key, value|
case value
when true
"--#{key}"
when Array
"--#{key} #{value.map(&:inspect).join(' ')}"
when Hash
"--#{key} #{value.map { |k, v| "#{k}:#{v}" }.join(' ')}"
when nil, false
nil
else
"--#{key} #{value.inspect}"
end
end.compact.join(" ")
end