org.edg.data.util
Class ClientHelp

java.lang.Object
  |
  +--org.edg.data.util.ClientHelp

public class ClientHelp
extends java.lang.Object

Helper class to do the help message formatting. This class is not thread-safe.

Version:
$Id: ClientHelp.java,v 1.8 2003/12/11 13:26:03 pkunszt Exp $
Author:
Peter Kunszt, James Casey

Constructor Summary
ClientHelp(int width, int startCommand, int startShortHand, int startDesc)
          Constructor.
 
Method Summary
 void printArgument(java.lang.String command, java.lang.String help)
           
 void printCommandHelp(org.edg.data.util.CommandDescriptor desc)
           
 void println()
          output a blank line to the help text
 void println(java.lang.String line)
          output a line of help
 void printUsageBlock(java.lang.String commandUsage, org.apache.commons.cli.Options opts)
          print a usage block.
 void printUsageBlock(java.lang.String commandUsage, java.lang.String header, org.apache.commons.cli.Options opts, java.lang.String footer)
          print a usage block.
 java.lang.String toString()
          return the help text currently stored
 void writeTo(java.io.PrintStream p)
          Output the help to a PrintStream, e.g.
 void writeTo(java.io.PrintWriter p)
          Output the help to a PrintWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientHelp

public ClientHelp(int width,
                  int startCommand,
                  int startShortHand,
                  int startDesc)
Constructor.

Parameters:
width - the total width of the help
startCommand - the starting position where the command should be set
startShortHand - the starting position for the shorthand notation (0 if there is none)
startDesc - the starting position for the description.
Method Detail

printCommandHelp

public void printCommandHelp(org.edg.data.util.CommandDescriptor desc)

printArgument

public void printArgument(java.lang.String command,
                          java.lang.String help)

printUsageBlock

public void printUsageBlock(java.lang.String commandUsage,
                            org.apache.commons.cli.Options opts)
print a usage block. commandUsage and opts must not be null

Parameters:
commandUsage -
opts -

printUsageBlock

public void printUsageBlock(java.lang.String commandUsage,
                            java.lang.String header,
                            org.apache.commons.cli.Options opts,
                            java.lang.String footer)
print a usage block. commandUsage and opts must not be null.

Parameters:
commandUsage -
header -
opts -
footer -

println

public void println()
output a blank line to the help text


println

public void println(java.lang.String line)
output a line of help

Parameters:
line - the help line

writeTo

public void writeTo(java.io.PrintStream p)
Output the help to a PrintStream, e.g. System.out

Parameters:
p - the PrintStream

writeTo

public void writeTo(java.io.PrintWriter p)
Output the help to a PrintWriter

Parameters:
p - the PrintWriter

toString

public java.lang.String toString()
return the help text currently stored

Overrides:
toString in class java.lang.Object
Returns:
the help text