MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / configure

Method configure

java/src/org/openqa/selenium/grid/Main.java:115–151  ·  view source on GitHub ↗
(PrintStream out, PrintStream err, String... args)

Source from the content-addressed store, hash-verified

113 }
114
115 @Override
116 public Executable configure(PrintStream out, PrintStream err, String... args) {
117 return () -> {
118 int longest =
119 commands.stream()
120 .filter(CliCommand::isShown)
121 .map(CliCommand::getName)
122 .max(Comparator.comparingInt(String::length))
123 .map(String::length)
124 .orElse(0)
125 + 2; // two space padding either side
126
127 PrintWriter outWriter = new WrappedPrintWriter(out, 72, 0);
128 outWriter.append(getName()).append("\n\n");
129 outWriter.append(getDescription()).append("\n").append("\n");
130
131 int indent = Math.min(longest + 2, 25);
132 String format = " %-" + longest + "s";
133
134 PrintWriter indented = new WrappedPrintWriter(out, 72, indent);
135 commands.stream()
136 .filter(CliCommand::isShown)
137 .forEach(cmd ->
138 indented.format(format, cmd.getName()).append(cmd.getDescription()).append("\n"));
139
140 outWriter.write("\nFor each command, run with `--help` for command-specific help\n");
141 outWriter.write(
142 "\nUse the `--ext` flag before the command name to specify an additional "
143 + "classpath to use with the server (for example, to provide additional "
144 + "commands, or to provide additional driver implementations). For example:\n");
145 outWriter.write(
146 String.format(
147 "%n java -jar selenium.jar --ext example.jar%sdir standalone --port 1234",
148 File.pathSeparator));
149 out.println("\n");
150 };
151 }
152 }
153}

Callers

nothing calls this directly

Calls 11

getNameMethod · 0.95
getDescriptionMethod · 0.95
writeMethod · 0.95
filterMethod · 0.80
getNameMethod · 0.65
getDescriptionMethod · 0.65
mapMethod · 0.45
streamMethod · 0.45
appendMethod · 0.45
forEachMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected