com.townleyenterprises.command
Class JoinedCommandOption
java.lang.Object
com.townleyenterprises.command.CommandOption
com.townleyenterprises.command.RepeatableCommandOption
com.townleyenterprises.command.JoinedCommandOption
- public class JoinedCommandOption
- extends RepeatableCommandOption
This class provides support for "joined" command options. Some
common examples of these are:
- From gcc:
-m[VALUE]
options for
machine-dependent behavior
-W[WARNING]
options for warning
levels
- From java:
-D[PROPERTY=VALUE]
options to
set system properties
-X[OPTION]
non-standard
extension options
Typically speaking, the value of the joined option must immediately
follow the option's short name or switch. However, this class
supports behavior to allow the value to also be specified as the
next argument in the argument list.
- Since:
- 2.1
- Version:
- $Id: JoinedCommandOption.java,v 1.2 2004/07/28 10:33:58 atownley Exp $
- Author:
- Andrew S. Townley
Constructor Summary |
JoinedCommandOption(char shortName,
boolean canSplit,
java.lang.String argHelp,
java.lang.String argDesc,
boolean show)
The constructor specifies only the arguments which make
sense for this type of option. |
Method Summary |
boolean |
getArgCanSplit()
This method is used to tell the parser if the option value
can follow the switch or it must be part of the switch. |
Methods inherited from class com.townleyenterprises.command.CommandOption |
execute, getArgumentDefault, getArgValue, getDescription, getExpectsArgument, getHelp, getLongName, getMatched, getName, getShortName, getShowArgInHelp, hashCode, parseOption, parseOptions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
JoinedCommandOption
public JoinedCommandOption(char shortName,
boolean canSplit,
java.lang.String argHelp,
java.lang.String argDesc,
boolean show)
- The constructor specifies only the arguments which make
sense for this type of option. These options do not
support long names.
- Parameters:
shortName
- this is the switch for the optioncanSplit
- true if this option can be split from the
value; false means that the value must be joined to
the switchargHelp
- the help string for the argumentargDesc
- the long description of what the argument
doesshow
- true if should be shown in autohelp
getArgCanSplit
public boolean getArgCanSplit()
- This method is used to tell the parser if the option value
can follow the switch or it must be part of the switch.
- Returns:
- true if the argument must be joined; false
otherwise
Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.