Class Main

java.lang.Object
org.apache.creadur.whisker.cli.Main

public final class Main extends Object
Command line interface for whisker.
  • Constructor Details

    • Main

      public Main(Whisker whisker)
      Constructs a wrapper for the given application.
      Parameters:
      whisker - not null
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Bootstraps application.
      Parameters:
      args - not null
      Throws:
      Exception - when application fails unexpectedly
    • parse

      public org.apache.commons.cli.CommandLine parse(String[] args) throws org.apache.commons.cli.ParseException
      Parses a line of arguments.
      Parameters:
      args - not null
      Returns:
      not null
      Throws:
      org.apache.commons.cli.ParseException - when parsing fails
    • configure

      public Whisker configure(String[] args) throws org.apache.commons.cli.ParseException
      Parses arguments and configures the application.
      Parameters:
      args - not null
      Returns:
      not null
      Throws:
      org.apache.commons.cli.ParseException - when arguments cannot be parsed
    • run

      public int run(String[] args) throws Exception
      Runs Whisker.
      Parameters:
      args - not null
      Returns:
      system return code
      Throws:
      Exception - when application unexpectedly fails
    • printHelp

      public boolean printHelp(String[] args) throws org.apache.commons.cli.ParseException
      Do these command line arguments ask for help?
      Parameters:
      args - not null
      Returns:
      true when command line contains option for help, false otherwise
      Throws:
      org.apache.commons.cli.ParseException - in case options could not be read properly.