|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mayo.bsi.ngsportal.server.GetOpts
public class GetOpts
A utility class to handle getting user options. A class that uses this must implement Usage,
in order to inform the user of the command options if there's a problem with parsing the user's
command line.
| Nested Class Summary | |
|---|---|
static class |
GetOpts.ArgType
Enumerated Type to specify the type of argument (if any) any option has |
static class |
GetOpts.OptType
Enumerated Type to specify the type of option. |
| Field Summary | |
|---|---|
static String |
kArgumentSeparator
Character that specifies how multiple arguments are separated in a return string |
static char |
kNoShortArg
Character that specifies that there is no short argument |
| Method Summary | |
|---|---|
static void |
addOption(char shortOption,
String longOption,
GetOpts.ArgType argument,
GetOpts.OptType required)
|
static String[] |
parseArgs(String[] args,
Usage target)
Parse a command line, given the already added GetOpts descriptions |
void |
setValue(String value)
Set the value. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char kNoShortArg
public static final String kArgumentSeparator
| Method Detail |
|---|
public final void setValue(String value)
value - the value to set
public static void addOption(char shortOption,
String longOption,
GetOpts.ArgType argument,
GetOpts.OptType required)
shortOption - Character of the option. '\0' if no short optionlongOption - Name of the option begins with -- if also a long option versionargument - Does it take an argumentrequired - Is this option optional, or required
public static String[] parseArgs(String[] args,
Usage target)
args - The elements of the command linetarget - Usage implementer to call if there's a problem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||