diff options
author | Amaury Levé <amaury.leve@sonarsource.com> | 2018-04-26 10:21:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-26 10:21:53 +0200 |
commit | 6b728171c3222c8e6697bb1c7e0616a6c9e5fc76 (patch) | |
tree | 7174f0be78a9c06962018cc24a984f2cae49f824 /src/main/java/org/sonarsource/scanner/cli | |
parent | c538e5bfb98002c9e1124bb1ddc74fa3e274cf72 (diff) | |
download | sonar-scanner-cli-6b728171c3222c8e6697bb1c7e0616a6c9e5fc76.tar.gz sonar-scanner-cli-6b728171c3222c8e6697bb1c7e0616a6c9e5fc76.zip |
SQSCANNER-49: Don't suggest debug if CLI is embeded (#48)
Diffstat (limited to 'src/main/java/org/sonarsource/scanner/cli')
-rw-r--r-- | src/main/java/org/sonarsource/scanner/cli/Cli.java | 8 | ||||
-rw-r--r-- | src/main/java/org/sonarsource/scanner/cli/Main.java | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/sonarsource/scanner/cli/Cli.java b/src/main/java/org/sonarsource/scanner/cli/Cli.java index c680241..f9a45ca 100644 --- a/src/main/java/org/sonarsource/scanner/cli/Cli.java +++ b/src/main/java/org/sonarsource/scanner/cli/Cli.java @@ -28,6 +28,7 @@ class Cli { private boolean debugEnabled = false; private boolean displayVersionOnly = false; + private boolean embedded = false; private final Properties props = new Properties(); private final Exit exit; private final Logs logger; @@ -45,6 +46,10 @@ class Cli { return displayVersionOnly; } + boolean isEmbedded() { + return embedded; + } + Properties properties() { return props; } @@ -84,6 +89,9 @@ class Cli { } else if (asList("-D", "--define").contains(arg)) { return processProp(args, pos); + } else if ("--embedded".equals(arg)) { + embedded = true; + } else if (arg.startsWith("-D")) { arg = arg.substring(2); appendPropertyTo(arg, props); diff --git a/src/main/java/org/sonarsource/scanner/cli/Main.java b/src/main/java/org/sonarsource/scanner/cli/Main.java index 2326f24..20b97bd 100644 --- a/src/main/java/org/sonarsource/scanner/cli/Main.java +++ b/src/main/java/org/sonarsource/scanner/cli/Main.java @@ -147,7 +147,9 @@ public class Main { } private void suggestDebugMode() { - logger.error("Re-run SonarQube Scanner using the -X switch to enable full debug logging."); + if (!cli.isEmbedded()) { + logger.error("Re-run SonarQube Scanner using the -X switch to enable full debug logging."); + } } } |