[KEYCLOAK-19309] - Minor fixes and improvements
This commit is contained in:
parent
5d560c1051
commit
fa1544a25e
4 changed files with 15 additions and 10 deletions
|
@ -45,7 +45,7 @@ do
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [[ $1 = --* || ! $1 =~ ^-.* ]]; then
|
if [[ $1 = --* || ! $1 =~ ^-D.* ]]; then
|
||||||
CONFIG_ARGS="$CONFIG_ARGS $1"
|
CONFIG_ARGS="$CONFIG_ARGS $1"
|
||||||
if [[ "$1" = "start-dev" ]]; then
|
if [[ "$1" = "start-dev" ]]; then
|
||||||
CONFIG_ARGS="$CONFIG_ARGS --auto-build"
|
CONFIG_ARGS="$CONFIG_ARGS --auto-build"
|
||||||
|
|
|
@ -116,7 +116,7 @@ public final class Picocli {
|
||||||
|
|
||||||
List<String> suggestedArgs = cliArgs.subList(1, cliArgs.size());
|
List<String> suggestedArgs = cliArgs.subList(1, cliArgs.size());
|
||||||
|
|
||||||
suggestedArgs.removeAll(Arrays.asList("--verbose", "--help"));
|
suggestedArgs.removeAll(Arrays.asList("--verbose", "-v", "--help", "-h"));
|
||||||
|
|
||||||
cmd.getOut().printf("For an optional runtime and bypass this step, please run the '%s' command prior to starting the server:%n%n\t%s config %s%n",
|
cmd.getOut().printf("For an optional runtime and bypass this step, please run the '%s' command prior to starting the server:%n%n\t%s config %s%n",
|
||||||
Build.NAME,
|
Build.NAME,
|
||||||
|
@ -330,7 +330,7 @@ public final class Picocli {
|
||||||
logError(errorWriter, "ERROR: " + message);
|
logError(errorWriter, "ERROR: " + message);
|
||||||
|
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
boolean verbose = cliArgs.stream().anyMatch("--verbose"::equals);
|
boolean verbose = cliArgs.contains("--verbose") || cliArgs.contains("-v");
|
||||||
|
|
||||||
if (throwable instanceof InitializationException) {
|
if (throwable instanceof InitializationException) {
|
||||||
InitializationException initializationException = (InitializationException) throwable;
|
InitializationException initializationException = (InitializationException) throwable;
|
||||||
|
|
|
@ -25,7 +25,7 @@ public abstract class AbstractStartCommand extends AbstractCommand implements Ru
|
||||||
|
|
||||||
public static final String AUTO_BUILD_OPTION = "--auto-build";
|
public static final String AUTO_BUILD_OPTION = "--auto-build";
|
||||||
|
|
||||||
@CommandLine.Option(names = AUTO_BUILD_OPTION, description = "Automatically detects whether the server configuration changed and a new server image must be built prior to starting the server. This option provides an alternative to manually running the '" + Build.NAME + "' prior to starting the server. Use this configuration carefully in production as it might impact the startup time.", required = false)
|
@CommandLine.Option(names = AUTO_BUILD_OPTION, description = "Automatically detects whether the server configuration changed and a new server image must be built prior to starting the server. This option provides an alternative to manually running the '" + Build.NAME + "' prior to starting the server. Use this configuration carefully in production as it might impact the startup time.", order = 1)
|
||||||
Boolean autoConfig;
|
Boolean autoConfig;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -52,16 +52,21 @@ import picocli.CommandLine.Option;
|
||||||
)
|
)
|
||||||
public final class Main {
|
public final class Main {
|
||||||
|
|
||||||
@Option(names = { "--help" }, description = "This help message.", usageHelp = true)
|
@CommandLine.Option(names = "-D<key>=<value>", description = "Set a Java system property", scope = CommandLine.ScopeType.INHERIT, order = 0)
|
||||||
|
Boolean sysProps;
|
||||||
|
|
||||||
|
@Option(names = { "-h", "--help" }, description = "This help message.", usageHelp = true)
|
||||||
boolean help;
|
boolean help;
|
||||||
|
|
||||||
@Option(names = { "--version" }, description = "Show version information", versionHelp = true)
|
@Option(names = { "-V", "--version" }, description = "Show version information", versionHelp = true)
|
||||||
boolean version;
|
boolean version;
|
||||||
|
|
||||||
@CommandLine.Option(names = "--verbose", description = "Print out more details when running this command. Useful for troubleshooting if some unexpected error occurs.", required = false,
|
@Option(names = { "-v", "--verbose" },
|
||||||
scope = CommandLine.ScopeType.INHERIT) Boolean verbose;
|
description = "Print out more details when running this command. Useful for troubleshooting if some unexpected error occurs.", required = false,
|
||||||
|
scope = CommandLine.ScopeType.INHERIT)
|
||||||
|
Boolean verbose;
|
||||||
|
|
||||||
@Option(names = "--config-file", arity = "1", description = "Set the path to a configuration file.", paramLabel = "<path>")
|
@Option(names = {"-cf", "--config-file"}, arity = "1", description = "Set the path to a configuration file.", paramLabel = "<path>")
|
||||||
public void setConfigFile(String path) {
|
public void setConfigFile(String path) {
|
||||||
System.setProperty(KeycloakConfigSourceProvider.KEYCLOAK_CONFIG_FILE_PROP, path);
|
System.setProperty(KeycloakConfigSourceProvider.KEYCLOAK_CONFIG_FILE_PROP, path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue