Skip to content

[MNG-8423] mvnenc -h #1971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
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;
Expand Down Expand Up @@ -103,6 +105,19 @@ public EncryptOptions interpolate(Collection<Map<String, String>> properties) {
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 diagnostic for encryption");
printStream.accept(" init - wizard to set-up encryption (interactive only)");
printStream.accept(" encrypt - encrypts input");
printStream.accept(" decrypt - decrypt encrypted input");
printStream.accept("");
}

protected static class CLIManager extends CommonsCliOptions.CLIManager {
public static final String FORCE = "f";
public static final String YES = "y";
Expand All @@ -119,10 +134,5 @@ protected void prepareOptions(org.apache.commons.cli.Options options) {
.desc("Should imply user answered \"yes\" to all incoming questions?")
.build());
}

@Override
protected String commandLineSyntax(String command) {
return command + " [options] [goal]";
}
}
}
Loading