def run(*parameters)
      name = parameters.shift
      if name.nil? || name == 'help'
        if command_name = parameters.first
          command = @commands[command_name]
          command.usage
        else
          usage
        end
      else
        command = @commands[name]
        if command.nil?
          @output.write("There is no command called '#{name}'.\n")
        else
          command.run(*parameters)
        end
      end
    end
def run(*parameters)
      name = parameters.shift
      if name.nil? || name == 'help'
        if command_name = parameters.first
          command = @commands[command_name]
          command.usage
        else
          usage
        end
      else
        command = @commands[name]
        if command.nil?
          @output.write("There is no command called '#{name}'.\n")
        else
          command.run(*parameters)
        end
      end
    end
Instantiate a CLI for an API described by a JSON schema.

 @param name [String] The name of the CLI.
 @param schema [Schema] The JSON schema describing the API.
 @param client [Client] A client generated from the JSON schema.
 @param output [IO] The stream to write to.
 Run a command.

 @param parameters [Array] The parameters to use when running the
   command.  The first parameters is the name of the command and the
   remaining parameters are passed to it.