-
- All Known Implementing Classes:
DefaultParser
public interface CommandLineParser
This Class-File has been copied, directly from the Apache Commons Software Foundation. Other than the minor, cosmetic changes (mentioned in the second-list below), this file is perfectly identical to the original that may be found on the Apache Website:apache.org
.- The suggested license for using this file may be read here:
Apache License
- The Source-Code Header for this file may be viewed here:
Source-File Header
- Partial contents of the
'site/resources/images'
directory:Resource Images
Notes about changes that have been made as a result of the import process:- Within all files, the original Package-Name declaration has been changed:
Original: package org.apache.commons.cli;
Updated: package Apache.CLI;
- All Classes and Class-Members (Methods, Fields, etc...) that were previously Annotated
with the
@Deprecated
Annotation have been summarily removed.
- Code Formattings and Styling has been heavily modified to conform to the Standard Java-HTML
Indentation & Styling Choices. The code itself remains identical, with only a few
squiggly-braces
'{' and '}'
being removed, for cosmetic reasons (and for lowering "Developer Stress" Levels)..
A class that implements theCommandLineParser
interface can parse a String array according to theOptions
specified and return aCommandLine
.
Hi-Lited Source-Code:- View Here: Apache/CLI/CommandLineParser.java
- Open New Browser-Tab: Apache/CLI/CommandLineParser.java
File Size: 2,269 Bytes Line Count: 54 '\n' Characters Found
-
-
Method Summary
Parse a ' public static void main(String[] argv)
' Argument-ListModifier and Type Method CommandLine
parse(Options options, String[] arguments)
Parses the arguments according to the specified options.Parse 'argv', but Decide whether to Throw Exceptions on Undefined Input-Arguments Modifier and Type Method CommandLine
parse(Options options, String[] arguments, boolean stopAtNonOption)
Parses the arguments according to the specified options.
-
-
-
Method Detail
-
parse
CommandLine parse(Options options, java.lang.String[] arguments) throws ParseException
Parses the arguments according to the specified options.- Parameters:
options
- the specified Optionsarguments
- the command line arguments- Returns:
- the list of atomic option and value tokens
- Throws:
ParseException
- if there are any problems encountered while parsing the command line tokens.
-
parse
CommandLine parse(Options options, java.lang.String[] arguments, boolean stopAtNonOption) throws ParseException
Parses the arguments according to the specified options.- Parameters:
options
- the specified Optionsarguments
- the command line argumentsstopAtNonOption
- iftrue
an unrecognized argument stops the parsing and the remaining arguments are added to theCommandLine
s args list. Iffalse
an unrecognized argument triggers a ParseException.- Returns:
- the list of atomic option and value tokens
- Throws:
ParseException
- if there are any problems encountered while parsing the command line tokens.
-
-