   A set of aliases can be given as the second argument:
 
       iex> OptionParser.parse(["-d"], aliases: [d: :debug])
-      { [debug: true], [] }
+      { [debug: true], [], [] }
 
   ## Switches
 

  Examples:

      iex> OptionParser.parse(["--unlock", "path/to/file"], switches: [unlock: :boolean])
      { [unlock: true], ["path/to/file"] }

      iex> OptionParser.parse(["--unlock", "--limit", "0", "path/to/file"],
      ...>                    switches: [unlock: :boolean, limit: :integer])
      { [unlock: true, limit: 0], ["path/to/file"] }

      iex> OptionParser.parse(["-limit", "3"], switches: [limit: :integer])
      { [limit: 3], [] }

      iex> OptionParser.parse(["-limit", "yyz"], switches: [limit: :integer])
      { [], [], [limit: "yyz"] }

  end

  defp parse([], _, _switches, dict, args, invalid, true) do
    { Enum.reverse(dict), Enum.reverse(args), invalid }
  end

  defp parse(value, _, _switches, dict, _args, invalid, false) do
    { Enum.reverse(dict), value, invalid }
  end

  defp value_from_tail(["-" <> _|_] = t), do: { true, t }
