This is an automated email from the ASF dual-hosted git repository. cstamas pushed a commit to branch fix-win-terminal in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit f592c6b268574b3ef3f326d158b8f78156384db0 Author: Guillaume Nodet <gno...@gmail.com> AuthorDate: Tue Jun 18 16:06:20 2024 +0200 Add the JLine diagnosis tool to the command line in the native client --- .../src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java | 6 ++++++ common/src/main/java/org/mvndaemon/mvnd/common/Environment.java | 2 ++ dist/src/main/distro/bin/mvnd-bash-completion.bash | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java index 1a2d143c..61c8aea7 100644 --- a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java +++ b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java @@ -85,6 +85,12 @@ public class DefaultClient implements Client { } } + // Diag + if (Environment.DIAG.removeCommandLineOption(args) != null) { + org.jline.terminal.impl.Diag.diag(System.out); + return; + } + // Serial if (Environment.SERIAL.removeCommandLineOption(args) != null) { System.setProperty(Environment.SERIAL.getProperty(), Boolean.toString(true)); diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java index 29faa6af..3132006f 100644 --- a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java +++ b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java @@ -59,6 +59,8 @@ public enum Environment { STATUS(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--status"), /** Stop all daemon instances registered in the registry specified by <code>mvnd.registry</code> */ STOP(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--stop"), + /** Terminal diagnosis */ + DIAG(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--diag"), /** Use one thread, no log buffering and the default project builder to behave like a standard maven */ SERIAL("mvnd.serial", null, Boolean.FALSE, OptionType.VOID, Flags.OPTIONAL, "mvnd:-1", "mvnd:--serial"), diff --git a/dist/src/main/distro/bin/mvnd-bash-completion.bash b/dist/src/main/distro/bin/mvnd-bash-completion.bash index ade2f771..692534a0 100755 --- a/dist/src/main/distro/bin/mvnd-bash-completion.bash +++ b/dist/src/main/distro/bin/mvnd-bash-completion.bash @@ -217,7 +217,7 @@ _mvnd() _get_comp_words_by_ref -n : cur prev local mvnd_opts="-1" - local mvnd_long_opts="--color|--completion|--purge|--raw-streams|--serial|--status|--stop" + local mvnd_long_opts="--color|--completion|--diag|--purge|--raw-streams|--serial|--status|--stop" local mvnd_properties="-Djava.home|-Djdk.java.options|-Dmaven.multiModuleProjectDirectory|-Dmaven.repo.local|-Dmaven.settings|-Dmvnd.buildTime|-Dmvnd.builder|-Dmvnd.cancelConnectTimeout|-Dmvnd.connectTimeout|-Dmvnd.coreExtensionsExclude|-Dmvnd.daemonStorage|-Dmvnd.debug|-Dmvnd.debug.address|-Dmvnd.duplicateDaemonGracePeriod|-Dmvnd.enableAssertions|-Dmvnd.expirationCheckDelay|-Dmvnd.home|-Dmvnd.idleTimeout|-Dmvnd.jvmArgs|-Dmvnd.keepAlive|-Dmvnd.logPurgePeriod|-Dmvnd.maxHeapSize|-Dmvnd [...] local opts="-am|-amd|-B|-C|-c|-cpu|-D|-e|-emp|-ep|-f|-fae|-ff|-fn|-gs|-h|-l|-N|-npr|-npu|-nsu|-o|-P|-pl|-q|-rf|-s|-T|-t|-U|-up|-V|-v|-X|${mvnd_opts}" local long_opts="--also-make|--also-make-dependents|--batch-mode|--strict-checksums|--lax-checksums|--check-plugin-updates|--define|--errors|--encrypt-master-password|--encrypt-password|--file|--fail-at-end|--fail-fast|--fail-never|--global-settings|--help|--log-file|--non-recursive|--no-plugin-registry|--no-plugin-updates|--no-snapshot-updates|--offline|--activate-profiles|--projects|--quiet|--resume-from|--settings|--threads|--toolchains|--update-snapshots|--update-plugins|--show-v [...]