com.dalsemi.slush.command
Interface SlushCommand
- public abstract interface SlushCommand
The interface that any commands added to the SLUSH shell must implement.
- See Also:
com.dalsemi.slush.CommandInterpreter#addCommand(String, SlushCommand)
|
Method Summary |
void |
execute(java.io.InputStream in,
java.io.PrintStream out,
java.io.PrintStream err,
java.lang.String[] args,
java.util.Hashtable env)
Executes this command. |
java.lang.String |
getUsageString()
Returns a string describing the usage of the command and its arguments if any. |
getUsageString
public java.lang.String getUsageString()
- Returns a string describing the usage of the command and its arguments if any.
- Returns:
- the usage.
execute
public void execute(java.io.InputStream in,
java.io.PrintStream out,
java.io.PrintStream err,
java.lang.String[] args,
java.util.Hashtable env)
throws java.lang.Exception
- Executes this command.
- Parameters:
in - The input stream this command will use to receive input.out - The print stream this command should use to report any non-critical messages.err - The print stream this command should use to report any critical messages.args - The list of arguments given when this command was invoked. This does not include the command name itself.env - A table of environment variables.- Throws:
- java.lang.Exception - Any exception raised by the underlying command. The getMessage() method of this exception should be as descriptive as possible since the SLUSH shell will use it to report the exception back to the user.