Skip to content

Conversation

zachdaniel
Copy link
Contributor

Given this scenario:

OptionParser.parse!(["--foo_bar", "baz"], strict: [foo_bar: :string])

the current error message is:

** (OptionParser.ParseError) 1 error found!
--foo_bar : Missing argument of type string
    (elixir 1.17.2) lib/option_parser.ex:301: OptionParser.parse!/2
    iex:5: (file)

This PR fixes it to instead be

** (OptionParser.ParseError) 1 error found!
--foo_bar : Unknown option. Did you mean --foo-bar?
    (elixir 1.17.2) lib/option_parser.ex:301: OptionParser.parse!/2
    iex:5: (file)

Given this scenario:

`OptionParser.parse!(["--foo_bar", "baz"], strict: [foo_bar: :string])`

the current error message is:

```
** (OptionParser.ParseError) 1 error found!
--foo_bar : Missing argument of type string
    (elixir 1.17.2) lib/option_parser.ex:301: OptionParser.parse!/2
    iex:5: (file)
```

This PR fixes it to instead be

```
** (OptionParser.ParseError) 1 error found!
--foo_bar : Unknown option. Did you mean --foo-bar?
    (elixir 1.17.2) lib/option_parser.ex:301: OptionParser.parse!/2
    iex:5: (file)
```
@josevalim josevalim merged commit e8a6709 into elixir-lang:main Oct 23, 2024
9 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants