diff --git a/lib/thor.rb b/lib/thor.rb index cf999e6e..d20f332a 100644 --- a/lib/thor.rb +++ b/lib/thor.rb @@ -327,6 +327,8 @@ def subcommand_classes end def subcommand(subcommand, subcommand_class) + return subcommand_classes[subcommand.to_s] if subcommands.include? subcommand.to_s + subcommands << subcommand.to_s subcommand_class.subcommand_help subcommand subcommand_classes[subcommand.to_s] = subcommand_class