This method is only available on newer versions.
The first available version (v2_6_3) is shown here.
current_is_switch?()
protected
Check if the current value in peek is a registered switch.
Two booleans are returned. The first is true if the current value starts
with a hyphen; the second is true if it is a registered switch.
# File lib/bundler/vendor/thor/lib/thor/parser/options.rb, line 134
def current_is_switch?
case peek
when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
[true, switch?($1)]
when SHORT_SQ_RE
[true, $1.split("").any? { |f| switch?("-#{f}") }]
else
[false, false]
end
end