Class GCLI

java.lang.Object
com.Lomikel.Apps.CLI
com.Lomikel.Apps.GCLI

public class GCLI extends CLI
Groovy Command Line.
Author:
J.Hrivnac
  • Field Details

    • _sharedData

      protected static Binding _sharedData
    • _shell

      protected static GroovyShell _shell
    • _sh

      protected static org.apache.groovy.groovysh.Groovysh _sh
    • log

      private static org.apache.logging.log4j.Logger log
      Logging .
  • Constructor Details

    • GCLI

      public GCLI(String scriptSrc, String scriptArgs)
      Create.
      Parameters:
      scriptSrc - The additional script to be executed.
      scriptArgs - The arguments for the additional script.
  • Method Details

    • execute

      public String execute()
      Description copied from class: CLI
      Execute command line in required way.
      Specified by:
      execute in class CLI
      Returns:
      The execution result.
    • close

      public void close()
      Description copied from class: CLI
      Close.
      Specified by:
      close in class CLI
    • setupShell

      public String setupShell()
      Load standard init files and setup standard environment.
      Returns:
      The output of the setup.
    • parseArgs

      public static CommandLine parseArgs(String[] args, String helpMsg)
      Parse the cli arguments.
      Parameters:
      args - The cli arguments.
      helpMsg - The general help message.
      Returns:
      The parsed CommandLine.
    • evaluate

      private String evaluate(String cmd)
      Evaluate command in appropriate groovy shell (GroovyShell or Groovysh).
      Parameters:
      cmd - The commands to be evaluated.
      Returns:
      The result of the last command.
    • shell

      public GroovyShell shell()
      Returns:
      The GroovyShell.
    • sh

      public org.apache.groovy.groovysh.Groovysh sh()
      Give Groovysh.
      Returns:
      The Groovysh.