Class Main


public class Main extends CommandLineUtility
Entry point to access all command line tools.
  • Method Details

    • registerTool

      public static void registerTool(Class<? extends CommandLineUtility> tool)
      Registers a tool to be included in the CLI commands.
      Parameters:
      tool - the class implementing the tool
    • registerTool

      public static void registerTool(String name, Class<? extends CommandLineUtility> tool, boolean internal)
      Registers a tool to be included in the CLI commands.
      Parameters:
      name - the command name
      tool - the class implementing the tool
      internal - if true, the tool is hidden from the list of available commands
    • run

      public void run(org.apache.commons.cli.CommandLine commandLine) throws Exception
      Description copied from class: CommandLineUtility
      Runs this command line utility with the specified command line arguments.
      Specified by:
      run in class CommandLineUtility
      Parameters:
      commandLine - the command line arguments
      Throws:
      Exception - if any exception occurred while running this command
    • getOptions

      public org.apache.commons.cli.Options getOptions()
      Description copied from class: CommandLineUtility
      Returns the options made available by this command line utility. The base implementation automatically provides the -h,--help option. Implementations overriding this method and begin with a call to super.getOptions().
      Overrides:
      getOptions in class CommandLineUtility
      Returns:
      the options made available by this command line utility
    • showVersion

      protected void showVersion()
      Displays the version of this library.
    • showInfo

      protected void showInfo()
      Displays information about the system for debugging purposes.
    • showHelp

      protected void showHelp()
      Description copied from class: CommandLineUtility
      Format and display the help information that details the available command line options.
      Overrides:
      showHelp in class CommandLineUtility
    • main

      public static void main(String[] args) throws Exception
      The main entry point for this command line utility.
      Parameters:
      args - the command line arguments
      Throws:
      Exception - if an error occurred