Package org.exolab.castor.util
Class CommandLineOptions
java.lang.Object
org.exolab.castor.util.CommandLineOptions
A utility class for generating command line options.
- Version:
- $Revision$ $Date: 2006-04-10 16:39:24 -0600 (Mon, 10 Apr 2006) $
- Author:
- Keith Visco
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the flag to list of available command line options.void
Adds the flag to list of available command line options.void
Adds the flag to list of available command line options.void
Adds the flag to list of available command line options.getOptions
(String[] args) Parses the arguments into a hashtable with the proper flag as the key.void
printHelp
(PrintWriter pw) void
void
setComment
(String flag, String comment) Sets a comment for the flag.void
setOptional
(String flag, boolean optional) Sets whether or not a given flag is optional.void
setUsageInfo
(String flag, String usage) Sets the text to print after the flag when printing the usage line.
-
Constructor Details
-
CommandLineOptions
public CommandLineOptions()
-
-
Method Details
-
addFlag
Adds the flag to list of available command line options.- Parameters:
flag
- the flag to add as an available command line option.
-
addFlag
-
addFlag
-
addFlag
Adds the flag to list of available command line options.- Parameters:
flag
- The flag to add as an available command line option.usageText
- The text that appears after the flag in the usage string.comment
- A comment for the flag.optional
- When true, indicates that this flag is optional.
-
getOptions
Parses the arguments into a hashtable with the proper flag as the key. -
setComment
-
setOptional
Sets whether or not a given flag is optional.- Parameters:
flag
- the flag to set optionality for.optional
- the boolean indicating the optionality for the given flag.
-
setUsageInfo
-
printUsage
-
printHelp
-