GetArgs breaks up the passed-in string into two lists, one of the plain arguments, and one of the option-argument pairs. GetArgs creates com.SoftWoehr.util.Argument objects of each of these entities.
Each option is identified by a single character preceded by an option introducer. Remaining characters in such a lexeme are regarded as the argument to the option, e.g.,
-Djava.foo=barwhere -D is the option and java.foo=bar is the argument.
The option introducer is any individual character in the string returned by getOptionIntroducers()
, by default the sole character '-' "dash". This string of option introducers may be changed by setOptionIntroducers()
.
NOTE that all options are presumed to have option arguments, so if the lexeme recognized as an option consists only of the option introducer or an option introducer and one (1) following option character, the next lexeme in the command line following the option is regarded as the option argument UNLESS that next lexeme is itself an option, i.e., a string headed by a member of the current set of option introducers.
The position in which the command line argument or option-argument pair occurred is recorded in the Argument object also.
Derived from com.SoftWoehr.util.GetArgs by the author. @author $Author: chrisw $ @version $Revision: 1.1 $
|
|