Class Util

java.lang.Object
com.netflix.genie.agent.cli.Util

public final class Util extends Object
CLI utility methods.
Since:
4.0.0
  • Method Details

    • mangleBareDoubleDash

      public static String[] mangleBareDoubleDash(String[] args)
      Replace all "bare double dash" arguments in the input array.
      Parameters:
      args - the arguments array
      Returns:
      a new array with bare double dashes replaced by a special marker
    • unmangleBareDoubleDash

      public static String[] unmangleBareDoubleDash(String[] args)
      Restore "bare double dash" arguments in the input array.
      Parameters:
      args - the arguments array with where double dashes were replaced
      Returns:
      a new array with bare double dashes restored in place of the special marker
    • getOptionArguments

      public static String[] getOptionArguments(String[] args)
      Get a subset of arguments before the double dash (a.k.a. options).
      Parameters:
      args - the raw array of arguments
      Returns:
      an array of arguments. Possibly empty, possibly the same as the input array.
    • getOperandArguments

      public static String[] getOperandArguments(String[] args)
      Get a subset of argument after the double dash (a.k.a. operands)
      Parameters:
      args - the raw array of arguments
      Returns:
      an array of arguments. Possibly empty