   end
 
   @doc false
+  # TODO: Deprecate on Mix v1.8
   def cmd(command, options, callback) when is_function(callback, 1) do
     callback =
       if Keyword.get(options, :quiet, false) do

  """
  def cmd(command, options) when is_binary(command) and is_list(options) do
    collectable = Keyword.get(options, :into, "")
    env = validate_env(Keyword.get(options, :env, []))

    args =

    port = Port.open({:spawn, shell_command(command)},
                     [:stream, :binary, :exit_status, :hide, :use_stdio, {:env, env} | args])

    port_read(port, acc, callback)
  end

  defp port_read(port, acc, callback) do
    receive do
      {^port, {:data, data}} ->
        port_read(port, callback.(acc, {:cont, data}), callback)
      {^port, {:exit_status, status}} ->
        callback.(acc, :done)
        status
