[MNG-8423] mvnenc -h (#1971)

Expand mvnenc help

---

https://issues.apache.org/jira/browse/MNG-8423
This commit is contained in:
Tamas Cservenak 2024-12-12 15:23:28 +01:00 committed by GitHub
parent 54ffc5014e
commit 0f15ad70e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 5 deletions

View File

@ -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]";
}
}
}