Package org.jboss.migration.cli
Class CommandLineParser
- java.lang.Object
-
- org.jboss.migration.cli.commonscli.DefaultParser
-
- org.jboss.migration.cli.CommandLineParser
-
- All Implemented Interfaces:
CommandLineParser
public class CommandLineParser extends DefaultParser
- Author:
- emmartins
-
-
Field Summary
-
Fields inherited from class org.jboss.migration.cli.commonscli.DefaultParser
cmd, currentOption, currentToken, expectedOpts, options, skipParsing, stopAtNonOption
-
-
Constructor Summary
Constructors Constructor Description CommandLineParser(boolean handleConcatenatedOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidhandleConcatenatedOptions(String token)Breakstokeninto its constituent parts using the following algorithm.-
Methods inherited from class org.jboss.migration.cli.commonscli.DefaultParser
parse, parse, parse, parse
-
-
-
-
Method Detail
-
handleConcatenatedOptions
protected void handleConcatenatedOptions(String token) throws ParseException
Description copied from class:DefaultParserBreakstokeninto its constituent parts using the following algorithm.- ignore the first character ("-")
- foreach remaining character check if an
Optionexists with that id. - if an
Optiondoes exist then add that character prepended with "-" to the list of processed tokens. - if the
Optioncan have an argument value and there are remaining characters in the token then add the remaining characters as a token to the list of processed tokens. - if an
Optiondoes NOT exist ANDstopAtNonOptionIS set then add the special token "--" followed by the remaining characters and also the remaining tokens directly to the processed tokens list. - if an
Optiondoes NOT exist ANDstopAtNonOptionIS NOT set then add that character prepended with "-".
- Overrides:
handleConcatenatedOptionsin classDefaultParser- Parameters:
token- The current token to be burst at the first non-Option encountered.- Throws:
ParseException- if there are any problems encountered while parsing the command line token.
-
-