class Thor

def subcommand(subcommand, subcommand_class)

def subcommand(subcommand, subcommand_class)
  self.subcommands << subcommand.to_s
  subcommand_class.subcommand_help subcommand
  define_method(subcommand) do |*args|
    args, opts = Thor::Arguments.split(args)
    invoke subcommand_class, args, opts, :invoked_via_subcommand => true, :class_options => options
  end
end