Class CommandLineParser


  • public class CommandLineParser
    extends Object
    Print DigestIndexer command-line usage message.
    Author:
    Kristinn Sigurðsson
    • Constructor Detail

      • CommandLineParser

        public CommandLineParser​(String[] args,
                                 PrintWriter out)
                          throws org.apache.commons.cli.ParseException
        Constructor.
        Parameters:
        args - Command-line arguments to process.
        out - PrintStream to write on.
        Throws:
        org.apache.commons.cli.ParseException - Failed parse of command line.
    • Method Detail

      • usage

        public void usage()
        Print usage then exit.
      • usage

        public void usage​(int exitCode)
        Print usage then exit.
        Parameters:
        exitCode -
      • usage

        public void usage​(String message,
                          int exitCode)
        Print message then usage then exit.

        The JVM exits inside in this method.

        Parameters:
        message - Message to print before we do usage.
        exitCode - Exit code to use in call to System.exit.
      • message

        public void message​(String message,
                            int exitCode)
        Print message and then exit.

        The JVM exits inside in this method.

        Parameters:
        message - Message to print before we do usage.
        exitCode - Exit code to use in call to System.exit.
      • getCommandLineOptions

        public org.apache.commons.cli.Option[] getCommandLineOptions()
        Returns:
        Options passed on the command line.
      • getCommandLineArguments

        public List getCommandLineArguments()
        Returns:
        Arguments passed on the command line.
      • getCommandLine

        public org.apache.commons.cli.CommandLine getCommandLine()
        Returns:
        Command line.