Skip to content

Commit

Permalink
Error when the user puts options before the subcommand
Browse files Browse the repository at this point in the history
These will be silently ignored due to a bug in picocli (#833)
  • Loading branch information
mrexodia committed Aug 22, 2024
1 parent 2c15c57 commit 377bfe7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/crowdin/cli/Cli.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
public class Cli {

public static void main(String[] args) {
// Workaround for a bug in picocli where valid options before the subcommand are ignored
for (String arg : args) {
if (!arg.startsWith("--")) {
break;
}
System.out.printf("Option %s needs to be after the subcommand\n", arg);
System.exit(1);
}

try {
PicocliRunner picocliRunner = PicocliRunner.getInstance();
Actions actions = new CliActions();
Expand Down

0 comments on commit 377bfe7

Please sign in to comment.