Package Apache.CLI



Interface CommandLineParser

  • 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.

    1. The suggested license for using this file may be read here: Apache License
    2. The Source-Code Header for this file may be viewed here: Source-File Header
    3. 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 the CommandLineParser interface can parse a String array according to the Options specified and return a CommandLine.


    • Method Summary

       
      Parse a 'public static void main(String[] argv)' Argument-List
      Modifier 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 Options
        arguments - 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 Options
        arguments - the command line arguments
        stopAtNonOption - if true an unrecognized argument stops the parsing and the remaining arguments are added to the CommandLines args list. If false 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.