com.borland.primetime
Interface Command


public interface Command

Command-line flags parsed by com.borland.primtime.PrimeTime are processed by implementors of the Command interface.


Method Summary
 java.lang.String getCommandDescription()
          Returns a description used by the command-line help system.
 void invokeCommand(java.lang.String[] args)
          Called when the flag associated with the command is included on the command-line.
 void printCommandHelp(java.io.PrintStream printStream)
          Displays a brief description of the behavior of the command-line flag.
 boolean takesCommandArguments()
          Distinguishes marker flags from flags that are optionally followed by one or more arguments.
 

Method Detail

takesCommandArguments

public boolean takesCommandArguments()
Distinguishes marker flags from flags that are optionally followed by one or more arguments.
Returns:
True if the command can take one or more arguments, false otherwise.

invokeCommand

public void invokeCommand(java.lang.String[] args)
Called when the flag associated with the command is included on the command-line. Commands are invoked in the order in which they appear, and should deal with error conditions by invoking System.exit to prevent further processing.

Commands that need to change the default command executed at the end of command-line processing may call the registerCommand method of com.borland.primetime.PrimeTime to override the currently registered behavior.

Parameters:
args - The parameters that follow the flag on the command-line if the command takes arguments, null otherwise.

getCommandDescription

public java.lang.String getCommandDescription()
Returns a description used by the command-line help system.
Returns:
A one-line description of the command, or null if the command should not be listed in command-line help.

printCommandHelp

public void printCommandHelp(java.io.PrintStream printStream)
Displays a brief description of the behavior of the command-line flag. The description should include the meaning of arguments for commands that allow them and should include two leading spaces on each line.
Parameters:
printStream - The destination for the description.