Skip to content

Commit f99c87c

Browse files
committed
Reuse local variable
1 parent 2dde972 commit f99c87c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/thor/base.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def initialize(args = [], local_options = {}, config = {})
6060

6161
command_options = config.delete(:command_options) # hook for start
6262
parse_options = parse_options.merge(command_options) if command_options
63+
6364
if local_options.is_a?(Array)
6465
array_options = local_options
6566
hash_options = {}
@@ -85,9 +86,10 @@ def initialize(args = [], local_options = {}, config = {})
8586
end
8687

8788
self.class.class_exclusive_option_names.map { |n| relations[:exclusive_option_names] << n }
88-
disable_required_check = self.class.disable_required_check? config[:current_command]
8989
self.class.class_at_least_one_option_names.map { |n| relations[:at_least_one_option_names] << n }
9090

91+
disable_required_check = self.class.disable_required_check? current_command
92+
9193
opts = Thor::Options.new(parse_options, hash_options, stop_on_unknown, disable_required_check, relations)
9294

9395
self.options = opts.parse(array_options)

0 commit comments

Comments
 (0)