--- src/client/src/main/java/org/apache/karaf/client/Main.java 2014-11-27 14:48:03.540584900 +0100 +++ src/client/src/main/java/org/apache/karaf/client/Main.java 2014-11-27 14:49:11.078447800 +0100 @@ -51,8 +51,9 @@ int retryAttempts = 0; int retryDelay = 2; + boolean endOfOptionsMarkerReached = false; for (int i = 0; i < args.length; i++) { - if (args[i].charAt(0) == '-') { + if (!endOfOptionsMarkerReached && args[i].charAt(0) == '-') { if (args[i].equals("-a")) { port = Integer.parseInt(args[++i]); } else if (args[i].equals("-h")) { @@ -67,6 +68,8 @@ retryAttempts = Integer.parseInt(args[++i]); } else if (args[i].equals("-d")) { retryDelay = Integer.parseInt(args[++i]); + } else if (args[i].equals("--")) { + endOfOptionsMarkerReached = true; } else if (args[i].equals("--help")) { System.out.println("Apache Karaf client"); System.out.println(" -a [port] specify the port to connect to"); @@ -77,7 +80,7 @@ System.out.println(" -v raise verbosity"); System.out.println(" -r [attempts] retry connection establishment (up to attempts times)"); System.out.println(" -d [delay] intra-retry delay (defaults to 2 seconds)"); - System.out.println(" [commands] commands to run"); + System.out.println(" [--] [commands] commands to run"); System.out.println("If no commands are specified, the client will be put in an interactive mode"); System.exit(0); } else {