Skip to content

Commit

Permalink
MID-8842 ninja - fixed error messages, display (un-hide) option for d…
Browse files Browse the repository at this point in the history
…ownload version

(cherry picked from commit 89ba961)
  • Loading branch information
1azyman committed Sep 18, 2023
1 parent ec6f728 commit c1ab315
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@

package com.evolveum.midpoint.ninja.action;

import java.util.List;

import com.beust.jcommander.JCommander;
import org.apache.commons.lang3.StringUtils;

import com.evolveum.midpoint.ninja.util.NinjaUtils;

public class HelpAction extends Action<HelpOptions, ActionResult> {
public class HelpAction extends Action<HelpOptions, ActionResult<Void>> {

@Override
public String getOperationName() {
return null;
}

@Override
public ActionResult execute() throws Exception {
public ActionResult<Void> execute() throws Exception {
String command = options.getCommand();

JCommander jc = NinjaUtils.setupCommandLineParser();
Expand All @@ -33,8 +31,8 @@ public ActionResult execute() throws Exception {
log.error(
"Unknown command {}, known commands: {}",
command,
StringUtils.join(", ", List.of(jc.getCommands().keySet()).stream().sorted()));
return new ActionResult(null, 1);
StringUtils.join(jc.getCommands().keySet().stream().sorted().iterator(), ", "));
return new ActionResult<>(null, 1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class DownloadDistributionOptions extends UpgradeCommonOptions {
@Parameter(names = { P_DISTRIBUTION_DIRECTORY }, descriptionKey = "upgradeDistribution.distributionDirectory")
private File distributionDirectory;

@Parameter(names = { P_DISTRIBUTION_VERSION }, descriptionKey = "upgradeDistribution.distributionVersion", hidden = true)
@Parameter(names = { P_DISTRIBUTION_VERSION }, descriptionKey = "upgradeDistribution.distributionVersion")
private String distributionVersion = UpgradeConstants.SUPPORTED_VERSION_TARGET;

public File getDistributionArchive() {
Expand Down

0 comments on commit c1ab315

Please sign in to comment.