public class CommandExecutorImpl extends Object implements CommandExecutor
CommandExecutor
component.Constructor and Description |
---|
CommandExecutorImpl(AliasRegistry aliases,
CommandResolver resolver,
CommandLineParser parser) |
Modifier and Type | Method and Description |
---|---|
Object |
execute(Shell shell,
Object... args)
Execute a pre-processed command-line.
|
Object |
execute(Shell shell,
String line)
Execute a command-line, parsing out valid recognized syntax.
|
Object |
execute(Shell shell,
String name,
Object[] args)
Execute command name/path with the given arguments.
|
@Inject public CommandExecutorImpl(AliasRegistry aliases, CommandResolver resolver, CommandLineParser parser)
public Object execute(Shell shell, String line) throws Exception
CommandExecutor
execute
in interface CommandExecutor
shell
- The executing shell.line
- Raw command-line to parse and execute.Exception
- Command-line execution failed.public Object execute(Shell shell, Object... args) throws Exception
CommandExecutor
execute
in interface CommandExecutor
shell
- The executing shell.args
- Command arguments, first argument is expected to be the command/path to execute.Exception
- Command-line execution failed.public Object execute(Shell shell, String name, Object[] args) throws Exception
CommandExecutor
execute
in interface CommandExecutor
shell
- The executing shell.name
- Name of the command/path to execute.args
- Command arguments.Exception
- Command-line execution failed.Copyright © 2008-2012 Sonatype. All Rights Reserved.