     {config, argv} = parse_argv(argv)
     System.argv(argv)
 
-    run fn _ ->
+    fun = fn _ ->
       errors = process_commands(config)
 
       if errors != [] do
         Enum.each(errors, &IO.puts(:stderr, &1))
         System.halt(1)
       end
-    end, config.halt
+    end
+
+    run(fun, config.halt)
   end
 
   @doc """


  defp process_command({:script, file}, _config) when is_binary(file) do
    if exec = find_elixir_executable(file) do
      wrapper fn -> Code.require_file(exec) end
    else
      {:error, "-S : Could not find executable #{file}"}
    end

defmodule Kernel.CLI do
  @moduledoc false

  @blank_config %{
    commands: [],
    output: ".",
    compile: [],
    halt: true,
    compiler_options: [],
    errors: [],
    pa: [],
    pz: [],
    verbose_compile: false
  }

  @doc """
  This is the API invoked by Elixir boot process.
