Skip to content

Commit 2bc0700

Browse files
committed
[grid] Displaying config help properly when array of tables are used.
1 parent 2d47c42 commit 2bc0700

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ public boolean dumpConfigHelp(Config config, Set<Role> currentRoles, PrintStream
9090
return false;
9191
}
9292

93-
Map<String, Set<DescribedOption>> allOptions = DescribedOption.findAllMatchingOptions(currentRoles).stream()
93+
Map<String, Set<DescribedOption>> allOptions = DescribedOption
94+
.findAllMatchingOptions(currentRoles).stream()
9495
.collect(Collectors.toMap(
9596
DescribedOption::section,
9697
ImmutableSortedSet::of,
@@ -104,7 +105,17 @@ public boolean dumpConfigHelp(Config config, Set<Role> currentRoles, PrintStream
104105
demoToml.append("# ").append(option.description).append("\n");
105106
}
106107
demoToml.append("# Type: ").append(option.type).append("\n");
107-
demoToml.append(option.optionName).append(" = ").append(option.example(config)).append("\n\n");
108+
if (option.optionName.contains(String.format("%s.", section))) {
109+
demoToml.append("[[")
110+
.append(option.optionName)
111+
.append("]]")
112+
.append(option.example(config))
113+
.append("\n\n");
114+
} else {
115+
demoToml.append(option.optionName)
116+
.append(" = ")
117+
.append(option.example(config)).append("\n\n");
118+
}
108119
});
109120
demoToml.append("\n");
110121
});

0 commit comments

Comments
 (0)