 
   """
   def parse(argv, opts \\ []) when is_list(argv) and is_list(opts) do
-    config = compile_config(opts, all: true)
+    config =
+      Keyword.merge(opts, [all: true, strict: false])
+      |> compile_config()
     do_parse(argv, config, [], [], [])
   end
 

    end
  end

  defp normalize_option(<<?-, option :: binary>>, value, switches, _aliases) do
    normalize_option(get_negated(option, switches), value, switches)
  end

  defp normalize_option(option, value, switches, aliases) do
    option = get_option(option)
    if alias = aliases[option] do
      normalize_option({:default, alias}, value, switches)
    else
      {option, [:invalid], value}
    end
  end

  defp normalize_option({:negated, option}, nil, switches) do

  Low-level function that parses one option.
  """
  def next(argv, opts \\ []) when is_list(argv) and is_list(opts) do
    {aliases, switches, strict, _} = compile_config(opts)
    next(argv, aliases, switches, strict)
  end

  defp next([], _aliases, _switches, _strict) do
    {:error, []}
  end

  defp next(["--"|_]=argv, _aliases, _switches, _strict) do
    {:error, argv}
  end

  defp next(["-" <> option|rest], aliases, switches, strict) do
    {option, value} = split_option(option)
    opt = tag_option(option, switches, aliases)

    if strict and not option_defined?(opt, switches) do
      {_, opt_name} = opt
      {:error, {:undefined, opt_name, value}, rest}
    else
      {opt_name, kinds, value} = normalize_option(opt, value, switches)
      {value, kinds, rest} = normalize_value(value, kinds, rest)
      case validate_option(opt_name, value, kinds) do
        {:ok, new_value} -> {:ok, opt_name, new_value, rest}
        :invalid         -> {:error, {:value, opt_name, value}, rest}
      end
    end
  end

  defp next(argv, _aliases, _switches, _strict) do
    {:error, argv}
  end

  ## Helpers

  defp compile_config(opts) do
    aliases  = opts[:aliases]  || []
    switches = opts[:switches] || []
    strict   = opts[:strict]   || false
    all      = opts[:all]      || false
    {aliases, switches, strict, all}
  end

  defp validate_option(option, value, kinds) do
