Skip to content

Commit

Permalink
[MNG-8423] mvnenc -h
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Dec 12, 2024
1 parent 54ffc50 commit a9e14c7
Showing 1 changed file with 15 additions and 5 deletions.
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]";
}
}
}

0 comments on commit a9e14c7

Please sign in to comment.