Class CliTool



  • public class CliTool
    extends Object
    • Method Summary

      Modifier and Type Method and Description
      void printHelpAndExit()
      Prints the help message and terminates the JVM with the specified exit code.
      void printHelpAndExit(int exitCode)
      Prints the help message and terminates the JVM with the specified exit code.
      void printMessageAndExit(int exitCode, String message)
      Prints the specified message and terminates the JVM with the specified exit code.
      void printMessageAndExit(String message)
      Prints the specified message and terminates the JVM with an exit code of 1.
      void printMessageAndHelpAndExit(int exitCode, String message)
      Prints the specified message, followed by the help message and terminates the JVM with the specified exit code.
      void printMessageAndHelpAndExit(String message)
      Prints the specified message, followed by the help message and terminates the JVM with an exit code of 1.
      void printMessagesAndExit(int exitCode, String... messages)
      Prints the specified messages and terminates the JVM with the specified exit code.
      void printMessagesAndExit(String... messages)
      Prints the specified messages and terminates the JVM with an exit code of 1.
      void printMessagesAndHelpAndExit(int exitCode, String... messages)
      Prints the specified messages, followed by the help message and terminates the JVM with the specified exit code.
      void printMessagesAndHelpAndExit(String... messages)
      Prints the specified messages, followed by the help message and terminates the JVM with an exit code of 1.
    • Method Detail

      • printMessageAndExit

        public void printMessageAndExit(String message)
        Prints the specified message and terminates the JVM with an exit code of 1. Same as calling printMessageAndExit(int, String) with an exit code of 1.
        Parameters:
        message - the line to print
      • printMessageAndExit

        public void printMessageAndExit(int exitCode,
                                        String message)
        Prints the specified message and terminates the JVM with the specified exit code.
        Parameters:
        exitCode - the exit code to use for System.exit(int)
        message - the line to print
      • printMessagesAndExit

        public void printMessagesAndExit(String... messages)
        Prints the specified messages and terminates the JVM with an exit code of 1. Same as calling printMessagesAndExit(int, String...) with an exit code of 1.
        Parameters:
        messages - the lines to print
      • printMessagesAndExit

        public void printMessagesAndExit(int exitCode,
                                         String... messages)
        Prints the specified messages and terminates the JVM with the specified exit code.
        Parameters:
        exitCode - the exit code to use for System.exit(int)
        messages - the lines to print
      • printHelpAndExit

        public void printHelpAndExit()
        Prints the help message and terminates the JVM with the specified exit code. Same as calling printHelpAndExit(int) with an exit code of 1.
      • printHelpAndExit

        public void printHelpAndExit(int exitCode)
        Prints the help message and terminates the JVM with the specified exit code.
        Parameters:
        exitCode - the exit code to use for System.exit(int)
      • printMessageAndHelpAndExit

        public void printMessageAndHelpAndExit(String message)
        Prints the specified message, followed by the help message and terminates the JVM with an exit code of 1. Same as calling printMessageAndHelpAndExit(int, String) with an exit code of 1.
        Parameters:
        message - the line to print in front of the help message
      • printMessageAndHelpAndExit

        public void printMessageAndHelpAndExit(int exitCode,
                                               String message)
        Prints the specified message, followed by the help message and terminates the JVM with the specified exit code.
        Parameters:
        exitCode - the exit code to use for System.exit(int)
        message - the line to print in front of the help message
      • printMessagesAndHelpAndExit

        public void printMessagesAndHelpAndExit(String... messages)
        Prints the specified messages, followed by the help message and terminates the JVM with an exit code of 1. Same as calling printMessagesAndHelpAndExit(int, String...) with an exit code of 1.
        Parameters:
        messages - the lines to print in front of the help message
      • printMessagesAndHelpAndExit

        public void printMessagesAndHelpAndExit(int exitCode,
                                                String... messages)
        Prints the specified messages, followed by the help message and terminates the JVM with the specified exit code.
        Parameters:
        exitCode - the exit code to use for System.exit(int)
        messages - the lines to print in front of the help message