Class Main

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

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

    Constructors
    Constructor
    Description
    Main(org.apache.creadur.whisker.app.Whisker whisker)
    Constructs a wrapper for the given application.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.creadur.whisker.app.Whisker
    configure(String[] args)
    Parses arguments and configures the application.
    static void
    main(String[] args)
    Bootstraps application.
    org.apache.commons.cli.CommandLine
    parse(String[] args)
    Parses a line of arguments.
    boolean
    printHelp(String[] args)
    Do these command line arguments ask for help?
    int
    run(String[] args)
    Runs Whisker.

    Methods inherited from class java.lang.Object

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

    • Main

      public Main(org.apache.creadur.whisker.app.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 org.apache.creadur.whisker.app.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.