Class Main


  • public class Main
    extends Command
    Entry point for all command line operations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String[] args  
      (package private) Command command  
      private static java.io.PrintWriter NUL  
    • Constructor Summary

      Constructors 
      Constructor Description
      Main​(java.lang.String... args)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String description()  
      int execute​(java.io.PrintWriter out, java.io.PrintWriter err)
      Executes the given command.
      static void main​(java.lang.String... args)
      Main entry point for program invocations.
      java.lang.String usage​(CommandParser parser)  
      • Methods inherited from class java.lang.Object

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

      • NUL

        private static final java.io.PrintWriter NUL
      • args

        private final java.lang.String[] args
    • Constructor Detail

      • Main

        Main​(java.lang.String... args)
    • Method Detail

      • description

        public java.lang.String description()
        Specified by:
        description in class Command
        Returns:
        Short description of the command.
      • usage

        public java.lang.String usage​(CommandParser parser)
        Overrides:
        usage in class Command
        Parameters:
        parser - parser for this command
        Returns:
        usage string displayed for help
      • execute

        public int execute​(java.io.PrintWriter out,
                           java.io.PrintWriter err)
                    throws java.lang.Exception
        Description copied from class: Command
        Executes the given command.
        Specified by:
        execute in class Command
        Parameters:
        out - std out
        err - std err
        Returns:
        exit code, should be 0 for normal operation
        Throws:
        java.lang.Exception - any exception that my occur during execution
      • main

        public static void main​(java.lang.String... args)
                         throws java.lang.Exception
        Main entry point for program invocations.
        Parameters:
        args - program arguments
        Throws:
        java.lang.Exception - All internal exceptions are directly passed on to get printed on the console