From 3b4690194b40345f551e48c47ac90396c3e9ce2e Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Tue, 24 Jun 2014 10:43:09 +0200 Subject: [PATCH] Be clearer about required options --- src/com/limelight/Limelight.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/limelight/Limelight.java b/src/com/limelight/Limelight.java index cae04ac..6a4ddf9 100644 --- a/src/com/limelight/Limelight.java +++ b/src/com/limelight/Limelight.java @@ -178,7 +178,7 @@ public class Limelight implements NvConnectionListener { String audio = "default"; Level debug = Level.SEVERE; - for (int i = 0; i < args.length - 1; i++) { + for (int i = 0; i < args.length; i++) { if (args[i].equals("-input")) { if (i + 1 < args.length) { inputs.add(args[i+1]); @@ -262,6 +262,11 @@ public class Limelight implements NvConnectionListener { debug = Level.WARNING; } else if (args[i].equals("-vv")) { debug = Level.ALL; + } else if (args[i].startsWith("-")) { + System.out.println("Syntax Error: Unrecognized argument: " + args[i]); + parse = false; + } else if (host == null) { + host = args[i]; } else { System.out.println("Syntax Error: Unrecognized argument: " + args[i]); parse = false; @@ -285,8 +290,7 @@ public class Limelight implements NvConnectionListener { System.out.println(); System.out.println("Use ctrl-c to exit application"); System.exit(5); - } else - host = args[args.length-1]; + } if (bitrate == 0) { if (height<=720)