Class CommandLineParser


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

      Constructors 
      Constructor Description
      CommandLineParser​(java.lang.String[] args, java.io.PrintWriter out)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.commons.cli.CommandLine getCommandLine()  
      java.util.List getCommandLineArguments()  
      org.apache.commons.cli.Option[] getCommandLineOptions()  
      void message​(java.lang.String message, int exitCode)
      Print message and then exit.
      void usage()
      Print usage then exit.
      void usage​(int exitCode)
      Print usage then exit.
      void usage​(java.lang.String message, int exitCode)
      Print message then usage then exit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandLineParser

        public CommandLineParser​(java.lang.String[] args,
                                 java.io.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​(java.lang.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​(java.lang.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 java.util.List getCommandLineArguments()
        Returns:
        Arguments passed on the command line.
      • getCommandLine

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