class Bundler::Thor::Command

def formatted_usage(klass, namespace = true, subcommand = false)

and required options into the given usage.
Returns the formatted usage by injecting given required arguments
def formatted_usage(klass, namespace = true, subcommand = false)
  if ancestor_name
    formatted = "#{ancestor_name} ".dup # add space
  elsif namespace
    namespace = klass.namespace
    formatted = "#{namespace.gsub(/^(default)/, '')}:".dup
  end
  formatted ||= "#{klass.namespace.split(':').last} ".dup if subcommand
  formatted ||= "".dup
  # Add usage with required arguments
  formatted << if klass && !klass.arguments.empty?
                 usage.to_s.gsub(/^#{name}/) do |match|
                   match << " " << klass.arguments.map(&:usage).compact.join(" ")
                 end
               else
                 usage.to_s
               end
  # Add required options
  formatted << " #{required_options}"
  # Strip and go!
  formatted.strip
end