Skip to content

Commit 1aae7a3

Browse files
committed
[grid] Avoiding hacks to display config options properly
This makes the code a bit more decent and allows to display the configuration help properly when an option should be configured through an array of tables.
1 parent e0dde49 commit 1aae7a3

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

java/server/src/org/openqa/selenium/grid/config/ConfigFlags.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ public boolean dumpConfigHelp(Config config, Set<Role> currentRoles, PrintStream
105105
demoToml.append("# ").append(option.description).append("\n");
106106
}
107107
demoToml.append("# Type: ").append(option.type).append("\n");
108-
if (option.optionName.contains(String.format("%s.", section))) {
108+
if (option.prefixed) {
109109
demoToml.append("[[")
110+
.append(section)
111+
.append(".")
110112
.append(option.optionName)
111113
.append("]]")
112114
.append(option.example(config))

java/server/src/org/openqa/selenium/grid/config/ConfigValue.java

+2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@
3434

3535
String name();
3636

37+
boolean prefixed() default false;
38+
3739
String example();
3840
}

java/server/src/org/openqa/selenium/grid/config/DescribedOption.java

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class DescribedOption implements Comparable<DescribedOption> {
4848
public final String description;
4949
public final String type;
5050
public final String example;
51+
public final boolean prefixed;
5152
public final boolean repeats;
5253
public final boolean quotable;
5354
public final Set<String> flags;
@@ -61,6 +62,7 @@ public class DescribedOption implements Comparable<DescribedOption> {
6162
this.optionName = configValue.name();
6263
this.type = getType(type);
6364
this.description = parameter.description();
65+
this.prefixed = configValue.prefixed();
6466
this.repeats = isCollection(type);
6567
this.quotable = isTomlStringType(type);
6668
this.example = configValue.example();

0 commit comments

Comments
 (0)