org.exolab.castor.util
public class CommandLineOptions extends java.lang.Object
Constructor and Description |
---|
CommandLineOptions() |
Modifier and Type | Method and Description |
---|---|
void |
addFlag(java.lang.String flag)
Adds the flag to list of available command line options.
|
void |
addFlag(java.lang.String flag,
java.lang.String comment)
Adds the flag to list of available command line options.
|
void |
addFlag(java.lang.String flag,
java.lang.String usageText,
java.lang.String comment)
Adds the flag to list of available command line options.
|
void |
addFlag(java.lang.String flag,
java.lang.String usageText,
java.lang.String comment,
boolean optional)
Adds the flag to list of available command line options.
|
java.util.Properties |
getOptions(java.lang.String[] args)
Parses the arguments into a hashtable with the proper flag as the key.
|
void |
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 flag.
|
void |
setOptional(java.lang.String flag,
boolean optional)
Sets whether or not a given flag is optional.
|
void |
setUsageInfo(java.lang.String flag,
java.lang.String usage)
Sets the text to print after the flag when printing the usage line.
|
public void addFlag(java.lang.String flag)
flag
- the flag to add as an available command line option.public void addFlag(java.lang.String flag, java.lang.String comment)
flag
- the flag to add as an available command line option.comment
- a comment for the flag.public void addFlag(java.lang.String flag, java.lang.String usageText, java.lang.String comment)
flag
- the flag to add as an available command line option.comment
- a comment for the flag.usageText
- the text that appears after the flag in the
usage string.public void addFlag(java.lang.String flag, java.lang.String usageText, java.lang.String comment, boolean optional)
flag
- The flag to add as an available command line option.comment
- A comment for the flag.usageText
- The text that appears after the flag in the usage string.optional
- When true, indicates that this flag is optional.public java.util.Properties getOptions(java.lang.String[] args)
public void setComment(java.lang.String flag, java.lang.String comment)
flag
- the flag to set the comment for.comment
- the comment to use when printing help for the given flag.public void setOptional(java.lang.String flag, boolean optional)
flag
- the flag to set optionality for.optional
- the boolean indicating the optionality for the given flag.public void setUsageInfo(java.lang.String flag, java.lang.String usage)
flag
- the flag to set the usage info for.usage
- the usage text.public void printUsage(java.io.PrintWriter pw)
public void printHelp(java.io.PrintWriter pw)
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com