Drop -d option from CLI as it was not POSIX compliant

Closes gh-16663
This commit is contained in:
Andy Wilkinson
2019-07-09 09:48:49 +01:00
parent 7536d88ece
commit 9f253603db
3 changed files with 41 additions and 29 deletions

View File

@@ -188,9 +188,9 @@ public class CommandRunner implements Iterable<Command> {
List<String> rtn = new ArrayList<>(args.length);
boolean appArgsDetected = false;
for (String arg : args) {
// Allow apps to have a -d argument
// Allow apps to have a --debug argument
appArgsDetected |= "--".equals(arg);
if (("-d".equals(arg) || "--debug".equals(arg)) && !appArgsDetected) {
if ("--debug".equals(arg) && !appArgsDetected) {
continue;
}
rtn.add(arg);
@@ -284,7 +284,7 @@ public class CommandRunner implements Iterable<Command> {
}
Log.info("");
Log.info("Common options:");
Log.info(String.format("%n %1$s %2$-15s%n %3$s", "-d, --debug", "Verbose mode",
Log.info(String.format("%n %1$s %2$-15s%n %3$s", "--debug", "Verbose mode",
"Print additional status information for the command you are running"));
Log.info("");
Log.info("");