enhance: add KC_ env variables for verbose and .sh options (#41847)

* enhance: add KC_ env variables for verbose and .sh options

closes: #19213

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Peter Zaoral <pepo48@gmail.com>
Co-authored-by: Peter Zaoral <pepo48@gmail.com>
This commit is contained in:
Steven Hawkins 2025-08-20 13:46:06 -04:00 committed by GitHub
parent 75078e0af8
commit 03b5753c84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 10 deletions

View File

@ -140,16 +140,30 @@ if not "x%JAVA_OPTS_APPEND%" == "x" (
set JAVA_OPTS=%JAVA_OPTS% %JAVA_OPTS_APPEND%
)
if NOT "x%DEBUG%" == "x" (
set DEBUG_MODE=%DEBUG%
if NOT "x%KC_DEBUG%" == "x" (
set DEBUG_MODE=%KC_DEBUG%
) else (
if NOT "x%DEBUG%" == "x" (
set DEBUG_MODE=%DEBUG%
)
)
if NOT "x%DEBUG_PORT%" == "x" (
set DEBUG_PORT_VAR=%DEBUG_PORT%
if NOT "x%KC_DEBUG_PORT%" == "x" (
set DEBUG_PORT_VAR=%KC_DEBUG_PORT%
set DEBUG_ADDRESS=0.0.0.0:!DEBUG_PORT_VAR!
) else (
if NOT "x%DEBUG_PORT%" == "x" (
set DEBUG_PORT_VAR=%DEBUG_PORT%
set DEBUG_ADDRESS=0.0.0.0:!DEBUG_PORT_VAR!
)
)
if NOT "x%DEBUG_SUSPEND%" == "x" (
set DEBUG_SUSPEND_VAR=%DEBUG_SUSPEND%
if NOT "x%KC_DEBUG_SUSPEND%" == "x" (
set DEBUG_SUSPEND_VAR=%KC_DEBUG_SUSPEND%
) else (
if NOT "x%DEBUG_SUSPEND%" == "x" (
set DEBUG_SUSPEND_VAR=%DEBUG_SUSPEND%
)
)
rem Set debug settings if not already set

View File

@ -41,9 +41,9 @@ SERVER_OPTS="$SERVER_OPTS -Dpicocli.disable.closures=true"
SERVER_OPTS="$SERVER_OPTS -Dquarkus-log-max-startup-records=10000"
CLASSPATH_OPTS="'$(abs_path "../lib/quarkus-run.jar")'"
DEBUG_MODE="${DEBUG:-false}"
DEBUG_PORT="${DEBUG_PORT:-8787}"
DEBUG_SUSPEND="${DEBUG_SUSPEND:-n}"
DEBUG_MODE="${KC_DEBUG:-${DEBUG:-false}}"
DEBUG_PORT="${KC_DEBUG_PORT:-${DEBUG_PORT:-8787}}"
DEBUG_SUSPEND="${KC_DEBUG_SUSPEND:-${DEBUG_SUSPEND:-n}}"
DEBUG_ADDRESS="0.0.0.0:$DEBUG_PORT"
esceval() {

View File

@ -88,7 +88,8 @@ public final class Main {
@Option(names = { "-v", "--verbose" },
description = "Print out error details when running this command.",
paramLabel = NO_PARAM_LABEL,
scope = ScopeType.INHERIT)
scope = ScopeType.INHERIT,
defaultValue = "${env:KC_VERBOSE}")
public void setVerbose(boolean verbose) {
ExecutionExceptionHandler exceptionHandler = (ExecutionExceptionHandler) spec.commandLine().getExecutionExceptionHandler();
exceptionHandler.setVerbose(verbose);