Skip to content

Commit

Permalink
Merge pull request #41633 from gsmet/fix-cli-parsing
Browse files Browse the repository at this point in the history
Catch exceptions when running checkMissingCommand
  • Loading branch information
gsmet authored Jul 2, 2024
2 parents 8abd7e2 + f2455e3 commit c85f008
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ public Optional<String> checkMissingCommand(CommandLine root, String[] args) {
return Optional.empty();
} catch (UnmatchedArgumentException e) {
return Optional.of(args[0]);
} catch (Exception e) {
// For any other exceptions (e.g. MissingParameterException), we should just ignore.
// The problem is not that the command is missing but that the options might not be adequate.
// This will be handled by Picocli at a later step.
return Optional.empty();
}
}

Expand Down

0 comments on commit c85f008

Please sign in to comment.