RFR: 1275: An unknown sub-command gives a confusing error message [v3]

Guoxiong Li gli at openjdk.java.net
Sat Dec 18 14:59:21 UTC 2021


On Thu, 16 Dec 2021 13:55:55 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>>> I was expecting a more elegant solution to this. I would add a property/method on the Command interface that MutliCommandParser can use to check this. Something like Command::defaultCommandExpected.
>> 
>> Good idea. Should we add it in this patch? Or we should file another issue to implement it?
>
> This was meant as a suggestion for this patch. I don't think the current solution is ok to go in.
> 
> I'm not sure about the name of the new method, it's hard to come up with a good name for this property of a Command. It's trying to express if the default sub-command is expected to be run with arguments or not, or if it takes arguments at all, but putting all that in a method name becomes quite a mouthful.

What about `defaultCommandWarningEnabled`? Actually, the default sub-command is always invoked if no sub-command is provided. But the warning message are outputted optionally.

-------------

PR: https://git.openjdk.java.net/skara/pull/1257


More information about the skara-dev mailing list