OptionParser.parse_head
You're seeing just the function
parse_head
, go back to OptionParser module for more information.
Specs
Similar to parse/2
but only parses the head of argv
;
as soon as it finds a non-switch, it stops parsing.
See parse/2
for more information.
Example
iex> OptionParser.parse_head(
...> ["--source", "lib", "test/enum_test.exs", "--verbose"],
...> switches: [source: :string, verbose: :boolean]
...> )
{[source: "lib"], ["test/enum_test.exs", "--verbose"], []}
iex> OptionParser.parse_head(
...> ["--verbose", "--source", "lib", "test/enum_test.exs", "--unlock"],
...> switches: [source: :string, verbose: :boolean, unlock: :boolean]
...> )
{[verbose: true, source: "lib"], ["test/enum_test.exs", "--unlock"], []}