Closed bpacholek closed 8 years ago
I'm not a huge fan of this change, I'm having trouble understanding why it's necessary to change everything to protected. Can the SingleCommandApplication
take the command in its constructor? If so, do we still need to overload everything? Make with an example it would be clearer.
Another option would be to detect if command name was parsed in the constructor and modify both expression parser and commands to behave differently then, right.
Will provide a new PR.
In order to develop Single command applications it is required to use the defaultCommand. To do we need to overload the
ExpressionParser
. In the method parse we need to disable the line:and later passing of the name:
There would be no problem in that, but since methods like
parseOption
,startsWith
(etc.) are private it is required to repeat them in the child class. Having them protected would allow use of inheritance:Going further, we need to update the method
createCommand
, but we also need to overloadcommand
as it callscreateCommand
of the parent scope if not overloaded. If overloaded then we need to repeatassertCallableIsValid
(etc.) again to be accessible.