com.townleyenterprises.command
Class JoinedCommandOption

java.lang.Object
  extended bycom.townleyenterprises.command.CommandOption
      extended bycom.townleyenterprises.command.RepeatableCommandOption
          extended bycom.townleyenterprises.command.JoinedCommandOption

public class JoinedCommandOption
extends RepeatableCommandOption

This class provides support for "joined" command options. Some common examples of these are:

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.RepeatableCommandOption
addArg, getArg, getArgs, optionMatched, reset
 
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
 

Constructor Detail

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 option
canSplit - true if this option can be split from the value; false means that the value must be joined to the switch
argHelp - the help string for the argument
argDesc - the long description of what the argument does
show - true if should be shown in autohelp
Method Detail

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.