Class CmdUtils
java.lang.Object
org.aksw.commons.picocli.CmdUtils
callCmd: Run command and return the exit code
execCmd: Run command and terminate the JVM using System.exit with the exit code
- Author:
- raven
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic intstatic intcallCmdObject(Object cmdInstance, String[] args) Utility method to launch a command with a generally useful exception handling configuration: If the command supports HasDebugMode then display of exception is as follows: on: the full stack trace is shown off: only the root cause message (without the stack trace) of an exception is shown If the debug flag is not supported then the output matches the debug=on case (full stack trace is shown).static voidstatic voidstatic voidexecCmdObject(Object cmdInstance, String[] args) static picocli.CommandLineregisterIfAvailable(picocli.CommandLine commandLine, String className) Attempt to register a command by class name.
-
Constructor Details
-
CmdUtils
public CmdUtils()
-
-
Method Details
-
execCmd
-
execCmdObject
-
execCmd
-
callCmd
-
callCmdObject
Utility method to launch a command with a generally useful exception handling configuration: If the command supports HasDebugMode then display of exception is as follows: on: the full stack trace is shown off: only the root cause message (without the stack trace) of an exception is shown If the debug flag is not supported then the output matches the debug=on case (full stack trace is shown).- Parameters:
cmdInstance-args-- Returns:
-
callCmd
-
registerIfAvailable
public static picocli.CommandLine registerIfAvailable(picocli.CommandLine commandLine, String className) Attempt to register a command by class name. If aClassNotFoundExceptionis raised then the command is ignored. Useful to deal with commands provided by maven dependencies that may needed to be excluded.
-