This is an automated email from the ASF dual-hosted git repository. cstamas pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push: new 0f15ad70e5 [MNG-8423] mvnenc -h (#1971) 0f15ad70e5 is described below commit 0f15ad70e50a58e1bf6b638f1e6310478c8f8141 Author: Tamas Cservenak <ta...@cservenak.net> AuthorDate: Thu Dec 12 15:23:28 2024 +0100 [MNG-8423] mvnenc -h (#1971) Expand mvnenc help --- https://issues.apache.org/jira/browse/MNG-8423 --- .../invoker/mvnenc/CommonsCliEncryptOptions.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/CommonsCliEncryptOptions.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/CommonsCliEncryptOptions.java index 7ec71cb787..c21e3dce95 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/CommonsCliEncryptOptions.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/CommonsCliEncryptOptions.java @@ -23,11 +23,13 @@ import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Optional; +import java.util.function.Consumer; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.ParseException; import org.apache.maven.api.cli.Options; +import org.apache.maven.api.cli.ParserRequest; import org.apache.maven.api.cli.mvnenc.EncryptOptions; import org.apache.maven.cling.invoker.CommonsCliOptions; import org.codehaus.plexus.interpolation.BasicInterpolator; @@ -103,6 +105,19 @@ public class CommonsCliEncryptOptions extends CommonsCliOptions implements Encry return interpolate(this, properties); } + @Override + public void displayHelp(ParserRequest request, Consumer<String> printStream) { + super.displayHelp(request, printStream); + printStream.accept(""); + // we have no DI here (to discover) + printStream.accept("Goals:"); + printStream.accept(" diag - display encryption configuration diagnostic"); + printStream.accept(" init - wizard to configure encryption (interactive only)"); + printStream.accept(" encrypt - encrypts input"); + printStream.accept(" decrypt - decrypts encrypted input"); + printStream.accept(""); + } + protected static class CLIManager extends CommonsCliOptions.CLIManager { public static final String FORCE = "f"; public static final String YES = "y"; @@ -119,10 +134,5 @@ public class CommonsCliEncryptOptions extends CommonsCliOptions implements Encry .desc("Should imply user answered \"yes\" to all incoming questions?") .build()); } - - @Override - protected String commandLineSyntax(String command) { - return command + " [options] [goal]"; - } } }