Search in sources :

Example 1 with PmCommandInvocation

use of org.jboss.galleon.cli.PmCommandInvocation in project galleon by wildfly.

the class AbstractDynamicCommand method buildCommand.

private MapProcessedCommand buildCommand() throws CommandLineParserException {
    MapProcessedCommandBuilder<PmCommandInvocation> builder = MapProcessedCommandBuilder.builder();
    builder.command(this);
    builder.lookupAtCompletionOnly(onlyAtCompletion);
    builder.name(getName());
    builder.activator(getActivator());
    List<ProcessedOption> otherOptions = getStaticOptions();
    for (ProcessedOption o : otherOptions) {
        staticOptions.add(o.name());
        if (o.name().equals(ARGUMENT_NAME)) {
            if (o.hasMultipleValues()) {
                builder.arguments(o);
            } else {
                builder.argument(o);
            }
        } else {
            builder.addOption(o);
        }
    }
    builder.description(getDescription());
    builder.optionProvider(new DynamicOptionsProvider());
    return builder.create();
}
Also used : ProcessedOption(org.aesh.command.impl.internal.ProcessedOption) PmCommandInvocation(org.jboss.galleon.cli.PmCommandInvocation)

Aggregations

ProcessedOption (org.aesh.command.impl.internal.ProcessedOption)1 PmCommandInvocation (org.jboss.galleon.cli.PmCommandInvocation)1