one.world
Interface Shell.Command

Enclosing class:
Shell

public static interface Shell.Command

Definition of a shell command.


Method Summary
 String getArguments()
          Get a description of the arguments for this command.
 String getDescription()
          Get a short description for this command.
 int getMaxArgs()
          Get the maximum number of arguments for this command.
 int getMinArgs()
          Get the minimum number of arguments for this command.
 String getName()
          Get the name of this command.
 void run(Shell shell, List args, List subst)
          Execute this command in the specified shell with the specified arguments.
 

Method Detail

getName

public String getName()
Get the name of this command.
Returns:
The name of this command.

getArguments

public String getArguments()
Get a description of the arguments for this command.
Returns:
A description of the arguments for this command.

getDescription

public String getDescription()
Get a short description for this command.
Returns:
A description for this command.

getMinArgs

public int getMinArgs()
Get the minimum number of arguments for this command.
Returns:
The minimum number of arguments.

getMaxArgs

public int getMaxArgs()
Get the maximum number of arguments for this command.
Returns:
The maximum number of arguments.

run

public void run(Shell shell,
                List args,
                List subst)
         throws Throwable
Execute this command in the specified shell with the specified arguments.

The arguments are specified as a list of strings. Their number is guaranteed to be consistent with the minimum and maximum number returned by getMinArgs() and getMaxArgs().

The list of substitutions passed to this method provides the arguments for replacing substitution tokens of the form "%<number>" with an actual argument. This method must perform substitution before using any argument.

Parameters:
shell - The shell.
args - The arguments.
subst - The substitutions (already performed).
Throws:
Throwable - Signals an exceptional condition when executing this command.
See Also:
Shell.substitute(List,List), Shell.substitute(String,List)


(C) Copyright 2001 UW CSE