/** * Is the given argument being completed? */ public boolean isSuggestingArgument(int index) { return isSuggesting() && getSuggestionContext().isArgument(index); }
/** * Is the given flag being completed? */ public boolean isSuggestingFlag(char flag) { return isSuggesting() && getSuggestionContext().isFlag(flag); }
/** * If the given flag is being completed, generate suggestions based on the given choices. */ public void suggestFlag(char flag, Iterable<String> choices) throws SuggestException { if(isSuggesting()) { getSuggestionContext().suggestFlag(flag, choices); } }
/** * If the given argument is being completed, generate suggestions based on the given choices. */ public void suggestArgument(int index, Iterable<String> choices) throws SuggestException { if(isSuggesting() && getSuggestionContext().isArgument()) { getSuggestionContext().suggestArgument(index, choices); } }
return Collections.emptyList(); } catch (InvocationTargetException e) { if (e.getCause() instanceof SuggestException && context.isSuggesting()) { return ((SuggestException) e.getCause()).suggestions(); } else if (e.getCause() instanceof CommandException) {