Skip to content

Commit 3dd0e8f

Browse files
committed
Merge pull request #358 from apotonick/dynamic_command
Simple Override Of DynamicCommand
2 parents 198865a + ee64166 commit 3dd0e8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/thor.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def dispatch(meth, given_args, given_opts, config) #:nodoc: # rubocop:disable Me
351351
end
352352
else
353353
args, opts = given_args, nil
354-
command = Thor::DynamicCommand.new(meth)
354+
command = dynamic_command_class.new(meth)
355355
end
356356

357357
opts = given_opts || opts || []
@@ -377,6 +377,10 @@ def baseclass #:nodoc:
377377
Thor
378378
end
379379

380+
def dynamic_command_class #:nodoc:
381+
Thor::DynamicCommand
382+
end
383+
380384
def create_command(meth) #:nodoc:
381385
if @usage && @desc
382386
base_class = @hide ? Thor::HiddenCommand : Thor::Command

0 commit comments

Comments
 (0)