Skip to content

Fix Command options parsing for underscored or dashed args #442

Closed
wants to merge 1 commit into from

2 participants

@mehlah
mehlah commented Apr 26, 2012

Li3 command line options wasn't parsed correctly in case of an underscored option like --foo_bar=something.
Dashed options are converted to an underscored form. --foo-bar will be available at $this->foo_bar

@davidpersson
Union of RAD member

We don't (or at least shouldn't) support long options containing underscores. Support for dashes in long options is already there so no need to change the parsing in the Router class. I've built upon one of the tests you've provided in 23d24d1 to reflect this. This behavior has additionally been documented in 884af54.

Thanks for bringing this to attention and providing the test!

@mehlah
mehlah commented Apr 30, 2012

We don't (or at least shouldn't) support long options containing underscores.

Okay with that

Support for dashes in long options is already there so no need to change the parsing in the Router class. I've built upon one of the tests you've provided in 23d24d1 to reflect this. This behavior has additionally been documented in 884af54.

The test you've added doesn't reflect that --foo-bar is parsed and available at $this->foo_bar in the command class.
That was the point of the PR.
I don't see where the parsing of dashes is handled and converted to an underscored form.

I missed something ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.