Skip to content

Commit f30f0c3

Browse files
committed
Use forbids attribute rather than checking manually.
1 parent ef46eba commit f30f0c3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/hudson/remoting/Launcher.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public void setConnectTo(String target) {
251251
@Option(name="-noReconnect",aliases="-noreconnect",usage="Doesn't try to reconnect when a communication fail, and exit instead")
252252
public boolean noReconnect = false;
253253

254-
@Option(name="-noReconnectAfter",usage = "Bail out after the given time after the first attempt to reconnect", handler = DurationSecondsOptionHandler.class)
254+
@Option(name="-noReconnectAfter",usage = "Bail out after the given time after the first attempt to reconnect", handler = DurationSecondsOptionHandler.class, forbids = "-noReconnect")
255255
public Duration noReconnectAfter;
256256

257257
@Option(name = "-noKeepAlive",
@@ -406,9 +406,6 @@ public static void main(String... args) throws IOException, InterruptedException
406406
System.err.println(
407407
"WARNING: Providing the secret and agent name as positional arguments is deprecated; use \"-secret\" and \"-name\" instead.");
408408
}
409-
if (launcher.noReconnect && launcher.noReconnectAfter != null) {
410-
throw new CmdLineException(null, "-noReconnect and -noReconnectAfter are mutually exclusive");
411-
}
412409
normalizeArguments(launcher);
413410
if (launcher.showHelp && !launcher.showVersion) {
414411
parser.printUsage(System.out);

0 commit comments

Comments
 (0)