You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user enters a command that doesn't exist (e.g. mis-typed a command), an exception is thrown.
Exception in thread "main" io.airlift.airline.ParseArgumentsUnexpectedException: Found unexpected parameters: [blah, something]
at io.airlift.airline.Cli.validate(Cli.java:148)
at io.airlift.airline.Cli.parse(Cli.java:116)
at io.airlift.airline.Cli.parse(Cli.java:97)
Since the end-user mistyping a command is an obvious use case, I'm assuming I've done something wrong. I've set Help as the default command, but I guess that isn't it.
My fix thus far is to catch the exception and run the Help command by re-parsing an empty command line. That seems like a hack. new Help().run() threw an exception, too, so that wasn't any better.
I feel like I'm missing an obvious solution, since none of the examples include catching an exception.
TIA!
Chris
The text was updated successfully, but these errors were encountered:
I haven't looked much into the airline code base yet, but I'll have a look and try to put a pull request together with a better solution, unless the maintainers are philosophically against this behaviour for some reason.
When the user enters a command that doesn't exist (e.g. mis-typed a command), an exception is thrown.
Exception in thread "main" io.airlift.airline.ParseArgumentsUnexpectedException: Found unexpected parameters: [blah, something]
at io.airlift.airline.Cli.validate(Cli.java:148)
at io.airlift.airline.Cli.parse(Cli.java:116)
at io.airlift.airline.Cli.parse(Cli.java:97)
Since the end-user mistyping a command is an obvious use case, I'm assuming I've done something wrong. I've set Help as the default command, but I guess that isn't it.
My fix thus far is to catch the exception and run the Help command by re-parsing an empty command line. That seems like a hack. new Help().run() threw an exception, too, so that wasn't any better.
I feel like I'm missing an obvious solution, since none of the examples include catching an exception.
TIA!
Chris
The text was updated successfully, but these errors were encountered: