FileDocCategorySizeDatePackage
HelpCommand.javaAPI DocGlassfish v2 API4153Fri May 04 22:25:10 BST 2007com.sun.enterprise.cli.commands

HelpCommand

public class HelpCommand extends Command
The help command will display the help text for all the commands and their options

Fields Summary
private static final int
DEFAULT_PAGE_LENGTH
private static final int
NO_PAGE_LENGTH
private static final String
DEFAULT_HELP_PAGE
Constructors Summary
public HelpCommand()
Creates new HelpCommand


            
    
  
  
Methods Summary
private java.lang.StringgetCommandName()

	return (operands.size() > 0
			? (String) getOperands().get(0)
			: DEFAULT_HELP_PAGE);
  
private java.io.WritergetDestination()

	return new OutputStreamWriter(System.out);
  
private intgetPageLength()

      if ((getOption("isMultiMode")!=null &&
          getBooleanOption("isMultiMode")) &&
          (getOption("interactive")!=null &&
           getBooleanOption("interactive")) )
          return DEFAULT_PAGE_LENGTH;
      else
          return NO_PAGE_LENGTH;
  
private java.lang.StringgetPrompt()

      return getLocalizedString("ManpagePrompt");
  
private java.lang.StringgetQuitChar()

      return getLocalizedString("ManpageQuit");
  
private java.io.ReadergetSource()

	CLIManFileFinder c = new CLIManFileFinder();
	return c.getCommandManFile(getCommandName());
  
private java.io.ReadergetUserInput()

	return new InputStreamReader(System.in);
  
private java.io.WritergetUserOutput()

	return new OutputStreamWriter(System.err);
  
public voidrunCommand()
Executes the command

throws
CommandException


	try {
	new More(getPageLength(),
        getSource(),
        getDestination(),
        getUserInput(),
        getUserOutput(),
        getQuitChar(),
        getPrompt());
	}
	catch (IOException ioe){
	  throw new CommandException(ioe);
	}
  
public booleanvalidateOptions()
override abstract method validateOptions()

        return true;