io.airlift.command.GroupSuggester Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of airline Show documentation
Show all versions of airline Show documentation
Airline is a Java annotation-based framework for parsing Git like command line structures.
The newest version!
package io.airlift.command;
import io.airlift.command.model.CommandGroupMetadata;
import io.airlift.command.model.CommandMetadata;
import io.airlift.command.model.OptionMetadata;
import javax.inject.Inject;
import static com.google.common.collect.Iterables.concat;
import static com.google.common.collect.Iterables.transform;
public class GroupSuggester
implements Suggester
{
@Inject
public CommandGroupMetadata group;
@Override
public Iterable suggest()
{
return concat(
transform(group.getCommands(), CommandMetadata.nameGetter()),
concat(transform(group.getOptions(), OptionMetadata.optionsGetter()))
);
}
}