Skip to content

Commit dc3f45d

Browse files
committed
force_current_to_be_value => is_switch_value
1 parent 214acdb commit dc3f45d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/thor/parser/options.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def initialize(hash_options = {}, defaults = {}, stop_on_unknown = false, disabl
4545
@switches = {}
4646
@extra = []
4747
@stopped_parsing_after_extra_index = nil
48-
@force_current_to_be_value = false
48+
@is_switch_value = false
4949

5050
options.each do |option|
5151
@switches[option.switch_name] = option
@@ -76,18 +76,18 @@ def peek
7676
end
7777

7878
def shift
79-
@force_current_to_be_value = false
79+
@is_switch_value = false
8080
super
8181
end
8282

8383
def unshift(arg, force_value: false)
84-
@force_current_to_be_value = force_value
84+
@is_switch_value = force_value
8585
super(arg)
8686
end
8787

8888
def parse(args) # rubocop:disable MethodLength
8989
@pile = args.dup
90-
@force_current_to_be_value = false
90+
@is_switch_value = false
9191
@parsing_options = true
9292

9393
while peek
@@ -163,7 +163,7 @@ def assign_result!(option, result)
163163
# Two booleans are returned. The first is true if the current value
164164
# starts with a hyphen; the second is true if it is a registered switch.
165165
def current_is_switch?
166-
return [false, false] if @force_current_to_be_value
166+
return [false, false] if @is_switch_value
167167
case peek
168168
when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
169169
[true, switch?($1)]
@@ -175,7 +175,7 @@ def current_is_switch?
175175
end
176176

177177
def current_is_switch_formatted?
178-
return false if @force_current_to_be_value
178+
return false if @is_switch_value
179179
case peek
180180
when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM, SHORT_SQ_RE
181181
true
@@ -185,7 +185,7 @@ def current_is_switch_formatted?
185185
end
186186

187187
def current_is_value?
188-
return true if @force_current_to_be_value
188+
return true if @is_switch_value
189189
peek && (!parsing_options? || super)
190190
end
191191

0 commit comments

Comments
 (0)