Skip to content

Commit

Permalink
Merge pull request #35189 from iocanel/quarkus-cli-exclude-self
Browse files Browse the repository at this point in the history
Quarkus CLI fixes
  • Loading branch information
iocanel authored Aug 7, 2023
2 parents 901dce6 + cc368cf commit d298952
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ public int run(String... args) throws Exception {
boolean interactiveMode = Arrays.stream(args).noneMatch(arg -> arg.equals("--cli-test"));
Optional<String> testDir = Arrays.stream(args).dropWhile(arg -> !arg.equals("--cli-test-dir")).skip(1).findFirst();
boolean helpCommand = Arrays.stream(args).anyMatch(arg -> arg.equals("--help"));
boolean pluginCommand = args.length >= 1 && (args[0].equals("plug") || args[0].equals("plugin"));

try {
boolean existingCommand = checkMissingCommand(cmd, args).isEmpty();
// If the command already exists and is not a help command (that lists subcommands), then just execute
// without dealing with plugins
if (existingCommand && !helpCommand) {
// If the command already exists and is not a help command (that lists subcommands) or plugin command, then just execute
// without dealing with plugins.
// The reason that we check if its a plugin command is that plugin commands need PluginManager initialization.
if (existingCommand && !helpCommand && !pluginCommand) {
return cmd.execute(args);
}
PluginCommandFactory pluginCommandFactory = new PluginCommandFactory(output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class JBangCatalogService extends CatalogService<JBangCatalog> {
private final JBangSupport jbang;

public JBangCatalogService(MessageWriter output) {
this(output, "quarkus", "quarkusio");
this(output, "quarkus-", "quarkusio");
}

public JBangCatalogService(MessageWriter output, String pluginPrefix, String fallbackCatalog, String... remoteCatalogs) {
Expand Down

0 comments on commit d298952

Please sign in to comment.