Package: gngs

[Groovy] Class ToolBase

    • Constructor Summary

        Constructors 
        Constructor and description
        ToolBase ()
    • Methods Summary

        Methods 
        Type Params Return Type Name and description
        static void cli(java.lang.String usage, java.lang.String[] args, groovy.lang.Closure specBuilder)
        static void cli(java.lang.String usage, java.lang.String header, java.lang.String[] args, groovy.lang.Closure specBuilder)
        Create an instance of the enclosing class and call its run method after parsing options with a Cli instance configured by the provided specBiulder closure.
        void error(java.lang.String msg)
        Print a formatted error message and exit
        void printTitle()
        abstract void run()
        static void setProxy()
        Check if the http_proxy variable is set, and if no proxy set, initialize the system properties needed from there.
        void test(java.util.List<java.lang.String> args, groovy.lang.Closure c)
        A utility method to facilitate testing of tools that extend this class.
    • Inherited Methods Summary

        Inherited Methods 
        Methods inherited from class Name
        class java.lang.Object java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
    • Property Detail

      • static java.lang.String footer

      • static java.lang.ThreadLocal<ToolBase> test

    • Constructor Detail

      • ToolBase()

    • Method Detail

      • static void cli(java.lang.String usage, java.lang.String[] args, groovy.lang.Closure specBuilder)

      • static void cli(java.lang.String usage, java.lang.String header, java.lang.String[] args, groovy.lang.Closure specBuilder)

        Create an instance of the enclosing class and call its run method after parsing options with a Cli instance configured by the provided specBiulder closure.

        Parameters:
        usage - a string to present to the user explaining usage of the tool
        args - raw args from command line
        specBuilder - a closure to configure a groovy.util.CliBuilder via a Cli instance

      • void error(java.lang.String msg)

        Print a formatted error message and exit

      • void printTitle()

      • abstract void run()

      • static void setProxy()

        Check if the http_proxy variable is set, and if no proxy set, initialize the system properties needed from there.

      • void test(java.util.List<java.lang.String> args, groovy.lang.Closure c)

        A utility method to facilitate testing of tools that extend this class.

        To use this method, create an instance of the tools, then invoke the test method with the command line arguments to pass, and then execute actual functions within the closure callback.

        Parameters:
        args - the command line args
        c