public final class CliUtil extends Object
Modifier and Type | Method and Description |
---|---|
static ConsolePO |
createConsolePo(PrintStream ps,
String name,
Prof prof)
Create a progress observer and register if profiler is present.
|
static String |
getMetricsHelp()
Compose detailed help string on available metrics.
|
static String |
getUsageString(Class<?> paramsClass)
Get usage string of a given parameters object
|
static String |
getUsageString(Class<?> paramsClass,
String programNameOrNull)
Get usage string of a given parameters object
|
static String |
getUsageString(Object[] paramsObjects)
Get usage string of a given parameters object
|
static <T> T |
parseParameters(Class<T> paramsClass,
String[] args)
Parse parameters.
|
static void |
parseParameters(Object[] paramsObjects,
String[] args) |
static PrintStream |
printUsage(Class<?> paramsClass)
Print usage of a given parameters object.
|
static PrintStream |
printUsage(Object[] pa) |
public static <T> T parseParameters(Class<T> paramsClass, String[] args)
T
- Parameters typeparamsClass
- Parameters typeargs
- Command line argumentspublic static String getMetricsHelp()
public static String getUsageString(Class<?> paramsClass)
paramsClass
- Parameters object typepublic static String getUsageString(Class<?> paramsClass, String programNameOrNull)
paramsClass
- Parameters object typeprogramNameOrNull
- When not null
pass to JCommander.setProgramName(java.lang.String)
public static String getUsageString(Object[] paramsObjects)
paramsClass
- Parameters object typepublic static PrintStream printUsage(Class<?> paramsClass)
paramsClass
- Parameters object typepublic static PrintStream printUsage(Object[] pa)
public static ConsolePO createConsolePo(PrintStream ps, String name, Prof prof)
ps
- Target to pass to ConsolePO.ConsolePO(java.io.PrintStream, java.lang.String)
name
- Name to pass to ConsolePO.ConsolePO(java.io.PrintStream, java.lang.String)
prof
- Profiler instance to register or null