Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.jboss.aesh.console.command.container;

import org.jboss.aesh.cl.CommandLine;
import org.jboss.aesh.cl.parser.CommandLineParserException;
import org.jboss.aesh.cl.parser.CommandLineParser;
import org.jboss.aesh.cl.validator.CommandValidatorException;
Expand Down Expand Up @@ -68,4 +69,9 @@ CommandContainerResult executeCommand(AeshLine line, InvocationProviders invocat
CommandInvocation commandInvocation)
throws CommandLineParserException, OptionValidatorException,
CommandValidatorException, CommandException, InterruptedException;

CommandContainerResult executeCommand(CommandLine commandLine, InvocationProviders invocationProviders,
AeshContext aeshContext,
CommandInvocation commandInvocation)
throws CommandLineParserException, OptionValidatorException, CommandValidatorException, CommandException, InterruptedException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,20 @@ public CommandContainerResult executeCommand(AeshLine line, InvocationProviders
throws CommandLineParserException, OptionValidatorException, CommandValidatorException, CommandException, InterruptedException {

CommandLine commandLine = getParser().parse(line, false);
return executeCommand(commandLine, invocationProviders, aeshContext, commandInvocation);
}

@Override
public CommandContainerResult executeCommand(CommandLine commandLine, InvocationProviders invocationProviders,
AeshContext aeshContext,
CommandInvocation commandInvocation)
throws CommandLineParserException, OptionValidatorException, CommandValidatorException, CommandException, InterruptedException {

commandLine.getParser().getCommandPopulator().populateObject(commandLine, invocationProviders, aeshContext, true);
if(commandLine.getParser().getProcessedCommand().getValidator() != null &&
!commandLine.hasOptionWithOverrideRequired())
if (commandLine.getParser().getProcessedCommand().getValidator() != null
&& !commandLine.hasOptionWithOverrideRequired()) {
commandLine.getParser().getProcessedCommand().getValidator().validate(commandLine.getParser().getCommand());
}

CommandResult result = commandLine.getParser().getCommand().execute(commandInvocation);

Expand Down