Search in sources :

Example 1 with FileSystemPathArgument

use of org.jboss.as.cli.impl.FileSystemPathArgument in project wildfly-core by wildfly.

the class FilenameTabCompleterTestCase method setup.

@Before
public void setup() throws CliInitializationException {
    ctx = CommandContextFactory.getInstance().newCommandContext();
    final DefaultFilenameTabCompleter completer = new DefaultFilenameTabCompleter(ctx);
    final CommandHandlerWithArguments cmd = new CommandHandlerWithArguments() {

        @Override
        public boolean isAvailable(CommandContext ctx) {
            // TODO Auto-generated method stub
            return false;
        }

        @Override
        public boolean isBatchMode(CommandContext ctx) {
            // TODO Auto-generated method stub
            return false;
        }

        @Override
        public void handle(CommandContext ctx) throws CommandLineException {
        // TODO Auto-generated method stub
        }
    };
    arg = new FileSystemPathArgument(cmd, completer, 0, "arg");
    parsedCmd = new DefaultCallbackHandler();
}
Also used : CommandHandlerWithArguments(org.jboss.as.cli.handlers.CommandHandlerWithArguments) CommandContext(org.jboss.as.cli.CommandContext) FileSystemPathArgument(org.jboss.as.cli.impl.FileSystemPathArgument) DefaultFilenameTabCompleter(org.jboss.as.cli.handlers.DefaultFilenameTabCompleter) DefaultCallbackHandler(org.jboss.as.cli.operation.impl.DefaultCallbackHandler) Before(org.junit.Before)

Example 2 with FileSystemPathArgument

use of org.jboss.as.cli.impl.FileSystemPathArgument in project wildfly-core by wildfly.

the class EmbedHostControllerHandler method create.

static EmbedHostControllerHandler create(final AtomicReference<EmbeddedProcessLaunch> hostControllerReference, final CommandContext ctx, final boolean modular) {
    EmbedHostControllerHandler result = new EmbedHostControllerHandler(hostControllerReference);
    final FilenameTabCompleter pathCompleter = FilenameTabCompleter.newCompleter(ctx);
    if (!modular) {
        result.jbossHome = new FileSystemPathArgument(result, pathCompleter, "--jboss-home");
    }
    result.stdOutHandling = new ArgumentWithValue(result, new SimpleTabCompleter(new String[] { ECHO, DISCARD_STDOUT }), "--std-out");
    result.domainConfig = new ArgumentWithValue(result, DOMAIN_CONFIG);
    result.hostConfig = new ArgumentWithValue(result, HOST_CONFIG);
    result.dashC = new ArgumentWithValue(result, "-c");
    result.dashC.addCantAppearAfter(result.domainConfig);
    result.domainConfig.addCantAppearAfter(result.dashC);
    result.timeout = new ArgumentWithValue(result, "--timeout");
    result.emptyDomainConfig = new ArgumentWithoutValue(result, EMPTY_DOMAIN_CONFIG);
    result.removeExistingDomainConfig = new ArgumentWithoutValue(result, REMOVE_EXISTING_DOMAIN_CONFIG);
    result.emptyHostConfig = new ArgumentWithoutValue(result, EMPTY_HOST_CONFIG);
    result.removeExistingHostConfig = new ArgumentWithoutValue(result, REMOVE_EXISTING_HOST_CONFIG);
    return result;
}
Also used : SimpleTabCompleter(org.jboss.as.cli.handlers.SimpleTabCompleter) FileSystemPathArgument(org.jboss.as.cli.impl.FileSystemPathArgument) ArgumentWithValue(org.jboss.as.cli.impl.ArgumentWithValue) FilenameTabCompleter(org.jboss.as.cli.handlers.FilenameTabCompleter) ArgumentWithoutValue(org.jboss.as.cli.impl.ArgumentWithoutValue)

Example 3 with FileSystemPathArgument

use of org.jboss.as.cli.impl.FileSystemPathArgument in project wildfly-core by wildfly.

the class EmbedServerHandler method create.

static EmbedServerHandler create(final AtomicReference<EmbeddedProcessLaunch> serverReference, CommandContext ctx, boolean modular) {
    EmbedServerHandler result = new EmbedServerHandler(serverReference);
    final FilenameTabCompleter pathCompleter = FilenameTabCompleter.newCompleter(ctx);
    if (!modular) {
        result.jbossHome = new FileSystemPathArgument(result, pathCompleter, "--jboss-home");
    }
    result.stdOutHandling = new ArgumentWithValue(result, new SimpleTabCompleter(new String[] { ECHO, DISCARD_STDOUT }), "--std-out");
    result.serverConfig = new ArgumentWithValue(result, "--server-config");
    result.dashC = new ArgumentWithValue(result, "-c");
    result.dashC.addCantAppearAfter(result.serverConfig);
    result.serverConfig.addCantAppearAfter(result.dashC);
    result.adminOnly = new ArgumentWithValue(result, SimpleTabCompleter.BOOLEAN, "--admin-only");
    result.emptyConfig = new ArgumentWithoutValue(result, "--empty-config");
    result.removeExisting = new ArgumentWithoutValue(result, "--remove-existing");
    result.removeExisting.addRequiredPreceding(result.emptyConfig);
    result.timeout = new ArgumentWithValue(result, "--timeout");
    return result;
}
Also used : SimpleTabCompleter(org.jboss.as.cli.handlers.SimpleTabCompleter) FileSystemPathArgument(org.jboss.as.cli.impl.FileSystemPathArgument) ArgumentWithValue(org.jboss.as.cli.impl.ArgumentWithValue) FilenameTabCompleter(org.jboss.as.cli.handlers.FilenameTabCompleter) ArgumentWithoutValue(org.jboss.as.cli.impl.ArgumentWithoutValue)

Aggregations

FileSystemPathArgument (org.jboss.as.cli.impl.FileSystemPathArgument)3 FilenameTabCompleter (org.jboss.as.cli.handlers.FilenameTabCompleter)2 SimpleTabCompleter (org.jboss.as.cli.handlers.SimpleTabCompleter)2 ArgumentWithValue (org.jboss.as.cli.impl.ArgumentWithValue)2 ArgumentWithoutValue (org.jboss.as.cli.impl.ArgumentWithoutValue)2 CommandContext (org.jboss.as.cli.CommandContext)1 CommandHandlerWithArguments (org.jboss.as.cli.handlers.CommandHandlerWithArguments)1 DefaultFilenameTabCompleter (org.jboss.as.cli.handlers.DefaultFilenameTabCompleter)1 DefaultCallbackHandler (org.jboss.as.cli.operation.impl.DefaultCallbackHandler)1 Before (org.junit.Before)1