Skip to content

Commit

Permalink
hide log format parameter (DAT-13501) (#3822)
Browse files Browse the repository at this point in the history
hide log format parameter
  • Loading branch information
StevenMassaro committed Feb 16, 2023
1 parent a24f9b3 commit 670aa2e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Expand Up @@ -1079,7 +1079,7 @@ private void addGlobalArguments(CommandLine commandLine) {
}

//only show the first/standard variation of a name
if (i > 0) {
if (i > 0 || def.isHidden()) {
optionBuilder.hidden(true);
}

Expand Down
Expand Up @@ -37,6 +37,7 @@ public class ConfigurationDefinition<DataType> implements Comparable<Configurati
private static final Pattern ALLOWED_KEY_PATTERN = Pattern.compile("[a-zA-Z0-9._]+");

private boolean loggedUsingDefault = false;
private boolean hidden = false;

/**
* Constructor private to force {@link Builder} usage
Expand Down Expand Up @@ -195,6 +196,13 @@ public boolean isInternal() {
return internal;
}

/**
* Return true if this configuration should not be printed to the console for any help command.
*/
public boolean isHidden() {
return hidden;
}

@Override
public int compareTo(ConfigurationDefinition o) {
return this.getKey().compareTo(o.getKey());
Expand Down Expand Up @@ -326,6 +334,12 @@ public Building<DataType> setInternal(boolean internal) {
return this;
}

public Building<DataType> setHidden(boolean hidden) {
definition.hidden = hidden;

return this;
}

public Building<DataType> addAliases(Collection<String> aliases) {
for (String alias : aliases) {
if (!alias.contains(".")) {
Expand Down
Expand Up @@ -88,6 +88,7 @@ public class LiquibaseCommandLineConfiguration implements AutoloadedConfiguratio
"Open Source users default to unstructured \"" + LogFormat.TEXT + "\" logs to the console or output log files. " +
"Pro users have the option to set value as \"" + LogFormat.JSON + "\" or \"" + LogFormat.JSON_PRETTY + "\" to enable json-structured log files to the console or output log files.")
.setDefaultValue(LogFormat.TEXT)
.setHidden(true)
.setValueHandler((logFormat) -> {
if (logFormat == null) {
return null;
Expand Down

0 comments on commit 670aa2e

Please sign in to comment.