-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI - Rework how missing commands are detected
We had a problem here as most options are only valid in the context of the root command (for instance -D) so trying to parse them in the context of a subcommand or on their own will most probably fail. Also parsing recursively the command is non-efficient as we do a lot of parsing, especially since it was done twice (this was fixed too). The new approach uses the ParseResult generated once and get the knownledge from there. From my tests, it provides similar results and avoid false positives and running the parsing too many times. This should fix CliHelpTest#testCommandHelp() being flaky as not being able to interpret the options ended up triggering the missing command branch and then the JBang support. (cherry picked from commit fb4a379)
- Loading branch information
Showing
1 changed file
with
29 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters