@Override public CompletionMatch complete() throws CompletionException { org.crsh.cli.spi.Completion.Builder builder = org.crsh.cli.spi.Completion.builder(prefix.getValue()); Set<String> optionNames = prefix instanceof Token.Literal.Option.Short ? descriptor.getShortOptionNames() : descriptor.getLongOptionNames(); for (String optionName : optionNames) { if (optionName.startsWith(prefix.getValue())) { builder.add(optionName.substring(prefix.getValue().length()), true); } } return new CompletionMatch(Delimiter.EMPTY, builder.build()); } }
@Override public CompletionMatch complete() throws CompletionException { org.crsh.cli.spi.Completion.Builder builder = org.crsh.cli.spi.Completion.builder(prefix.getValue()); Set<String> optionNames = prefix instanceof Token.Literal.Option.Short ? descriptor.getShortOptionNames() : descriptor.getLongOptionNames(); for (String optionName : optionNames) { if (optionName.startsWith(prefix.getValue())) { builder.add(optionName.substring(prefix.getValue().length()), true); } } return new CompletionMatch(Delimiter.EMPTY, builder.build()); } }
@Override public CompletionMatch complete() throws CompletionException { org.crsh.cli.spi.Completion.Builder builder = org.crsh.cli.spi.Completion.builder(prefix.getValue()); Set<String> optionNames = prefix instanceof Token.Literal.Option.Short ? descriptor.getShortOptionNames() : descriptor.getLongOptionNames(); for (String optionName : optionNames) { if (optionName.startsWith(prefix.getValue())) { builder.add(optionName.substring(prefix.getValue().length()), true); } } return new CompletionMatch(Delimiter.EMPTY, builder.build()); } }