Package com.netflix.genie.agent.cli
Class Util
- java.lang.Object
-
- com.netflix.genie.agent.cli.Util
-
public final class Util extends java.lang.Object
CLI utility methods.- Since:
- 4.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String[]
getOperandArguments(java.lang.String[] args)
Get a subset of argument after the double dash (a.k.a.static java.lang.String[]
getOptionArguments(java.lang.String[] args)
Get a subset of arguments before the double dash (a.k.a.static java.lang.String[]
mangleBareDoubleDash(java.lang.String[] args)
Replace all "bare double dash" arguments in the input array.static java.lang.String[]
unmangleBareDoubleDash(java.lang.String[] args)
Restore "bare double dash" arguments in the input array.
-
-
-
Method Detail
-
mangleBareDoubleDash
public static java.lang.String[] mangleBareDoubleDash(java.lang.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 java.lang.String[] unmangleBareDoubleDash(java.lang.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 java.lang.String[] getOptionArguments(java.lang.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 java.lang.String[] getOperandArguments(java.lang.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
-
-