Package org.exolab.adaptx.util
Class CommandLineOptions
- java.lang.Object
-
- org.exolab.adaptx.util.CommandLineOptions
-
public class CommandLineOptions extends java.lang.Object
A utility class for generating command line options- Version:
- $Revision: 3633 $ $Date: 2003-03-01 08:38:44 +0100 (Sat, 01 Mar 2003) $
- Author:
- Keith Visco
-
-
Constructor Summary
Constructors Constructor Description CommandLineOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFlag(java.lang.String flag)
Adds the flag to list of available command line optionsvoid
addFlag(java.lang.String flag, java.lang.String comment)
Adds the flag to list of available command line optionsvoid
addFlag(java.lang.String flag, java.lang.String usageText, java.lang.String comment)
Adds the flag to list of available command line optionsjava.util.Properties
getOptions(java.lang.String[] args)
parses the arguments into a hashtable with the proper flag as the keyvoid
printHelp(java.io.PrintWriter pw)
void
printUsage(java.io.PrintWriter pw)
void
setComment(java.lang.String flag, java.lang.String comment)
Sets a comment for the flagvoid
setInvokeCommand(java.lang.String invokeCommand)
Sets the command used to invoke the applicationvoid
setOptional(java.lang.String flag, boolean optional)
Sets whether or not a given flag is optionalvoid
setUsageInfo(java.lang.String flag, java.lang.String usage)
Sets the text to print after the flag when printing the usage line
-
-
-
Method Detail
-
addFlag
public void addFlag(java.lang.String flag)
Adds the flag to list of available command line options- Parameters:
flag
- the flag to add as an available command line option
-
addFlag
public void addFlag(java.lang.String flag, java.lang.String comment)
Adds the flag to list of available command line options- Parameters:
flag
- the flag to add as an available command line optioncomment
- a comment for the flag
-
addFlag
public void addFlag(java.lang.String flag, java.lang.String usageText, java.lang.String comment)
Adds the flag to list of available command line options- Parameters:
flag
- the flag to add as an available command line optioncomment
- a comment for the flagusageText
- the text that appears after the flag in the usage string
-
getOptions
public java.util.Properties getOptions(java.lang.String[] args)
parses the arguments into a hashtable with the proper flag as the key
-
setComment
public void setComment(java.lang.String flag, java.lang.String comment)
Sets a comment for the flag- Parameters:
flag
- the flag to set the comment forcomment
- the comment to use when printing help for the given flag
-
setOptional
public void setOptional(java.lang.String flag, boolean optional)
Sets whether or not a given flag is optional- Parameters:
flag
- the flag to set optionality foroptional
- the boolean indicating the optionality for the given flag
-
setInvokeCommand
public void setInvokeCommand(java.lang.String invokeCommand)
Sets the command used to invoke the application- Parameters:
invokeCommand
- the command used to invoke the application
-
setUsageInfo
public void setUsageInfo(java.lang.String flag, java.lang.String usage)
Sets the text to print after the flag when printing the usage line- Parameters:
flag
- the flag to set the usage info forusage
- the usage text
-
printUsage
public void printUsage(java.io.PrintWriter pw)
-
printHelp
public void printHelp(java.io.PrintWriter pw)
-
-