   Examples:
 
       iex> OptionParser.parse(["--unlock", "path/to/file"], switches: [unlock: :boolean])
-      { [unlock: true], ["path/to/file"] }
+      { [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"] }
+      { [unlock: true, limit: 0], ["path/to/file"], [] }
 
       iex> OptionParser.parse(["-limit", "3"], switches: [limit: :integer])
-      { [limit: 3], [] }
+      { [limit: 3], [], [] }
 
       iex> OptionParser.parse(["-limit", "yyz"], switches: [limit: :integer])
       { [], [], [limit: "yyz"] }

  """

  @doc """
  Parses `argv` and returns a tuple with parsed options
  and arguments.

  ## Examples

      iex> OptionParser.parse(["--debug"])
      { [debug: true], [] }

      iex> OptionParser.parse(["--source", "lib"])
      { [source: "lib"], [] }

      iex> OptionParser.parse(["--source-path", "lib", "test/enum_test.exs", "--verbose"])
      { [source_path: "lib", verbose: true], ["test/enum_test.exs"] }

  Notice how Elixir automatically translates the "--source-path"
  switch to the underscored atom `:source_path`, which better follows

  ## Example

      iex> OptionParser.parse_head(["--source", "lib", "test/enum_test.exs", "--verbose"])
      { [source: "lib"], ["test/enum_test.exs", "--verbose"], [] }

      iex> OptionParser.parse_head(["--verbose", "--source", "lib", "test/enum_test.exs", "--unlock"])
      { [verbose: true, source: "lib"], ["test/enum_test.exs", "--unlock"], [] }
  """
  def parse_head(argv, opts // []) when is_list(argv) and is_list(opts) do
    parse(argv, opts, false)
