public static String format(NodeDiff diff) { AnsiStoryBuilder resultBuilder = new AnsiStoryBuilder(); format(diff, resultBuilder); return resultBuilder.toString(); }
@Override protected void executeThis() { AnsiPrinter.out.println(AnsiFormatUtils.format(AnsiFormatUtils.Format.YAML, Daemon.getTasks())); } }
@Override protected void executeThis() { AnsiPrinter.out.println(AnsiFormatUtils.format(AnsiFormatUtils.Format.YAML, Daemon.getTasks())); } }
public static String format(NodeDiff diff) { AnsiStoryBuilder resultBuilder = new AnsiStoryBuilder(); format(diff, resultBuilder); return resultBuilder.toString(); }
@Override protected void executeThis() { AnsiUi.success(AnsiFormatUtils.format(getAccount(getAccountName()))); }
@Override protected void executeThis() { AnsiUi.success(AnsiFormatUtils.format(getAccount(getAccountName()))); }
@Override protected void executeThis() { AnsiUi.success(AnsiFormatUtils.format(getCluster(getClusterName()))); }
@Override protected void executeThis() { AnsiUi.success(AnsiFormatUtils.format(getAccount(getAccountName()))); }
@Override protected void executeThis() { AnsiUi.success(AnsiFormatUtils.format(getAccount(getAccountName()))); }
@Override protected void executeThis() { AnsiUi.success(AnsiFormatUtils.format(getCluster(getClusterName()))); }
@Override public T get() { T res; try { res = operation.get(); } catch (ExpectedDaemonFailureException e) { throw new ExpectedDaemonFailureException(failureMesssage, e.getCause()); } catch (TaskKilledException e) { throw TaskKilledException.extendMessage(failureMesssage, e); } if (successMessage != null && !GlobalOptions.getGlobalOptions().isQuiet()) { AnsiUi.success(successMessage); } if (userFormatted) { Format userFormat = GlobalOptions.getGlobalOptions().getOutput(); if (userFormat != null) { format = userFormat; } } String result = AnsiFormatUtils.format(format, res); if (!result.isEmpty()) { AnsiPrinter.out.println(result); } return res; } }
@Override public T get() { T res; try { res = operation.get(); } catch (ExpectedDaemonFailureException e) { throw new ExpectedDaemonFailureException(failureMesssage, e.getCause()); } catch (TaskKilledException e) { throw TaskKilledException.extendMessage(failureMesssage, e); } if (successMessage != null && !GlobalOptions.getGlobalOptions().isQuiet()) { AnsiUi.success(successMessage); } if (userFormatted) { Format userFormat = GlobalOptions.getGlobalOptions().getOutput(); if (userFormat != null) { format = userFormat; } } String result = AnsiFormatUtils.format(format, res); if (!result.isEmpty()) { AnsiPrinter.out.println(result); } return res; } }
@Override protected void executeThis() { String deploymentName = getCurrentDeployment(); NodeDiff result = new OperationHandler<NodeDiff>() .setFailureMesssage("Failed to generate config diff.") .setOperation(Daemon.configDiff(deploymentName, !noValidate)) .get(); if (result == null) { AnsiUi.raw("No changes have been made to your configuration."); } else { AnsiUi.raw(AnsiFormatUtils.format(result)); } } }
@Override protected void executeThis() { String deploymentName = getCurrentDeployment(); NodeDiff result = new OperationHandler<NodeDiff>() .setFailureMesssage("Failed to generate config diff.") .setOperation(Daemon.configDiff(deploymentName, !noValidate)) .get(); if (result == null) { AnsiUi.raw("No changes have been made to your configuration."); } else { AnsiUi.raw(AnsiFormatUtils.format(result)); } } }
@Override protected void executeThis() { BillOfMaterials bom = new OperationHandler<BillOfMaterials>() .setOperation(Daemon.getBillOfMaterials(getVersion())) .setFailureMesssage("Failed to get Bill of Materials for version " + getVersion()) .get(); String result; if (artifactName == null) { AnsiFormatUtils.Format format = GlobalOptions.getGlobalOptions().getOutput(); if (format == null) { format = AnsiFormatUtils.Format.YAML; } result = AnsiFormatUtils.format(format, bom); } else { result = bom.getArtifactVersion(artifactName); } AnsiPrinter.out.println(result); } }
@Override protected void executeThis() { BillOfMaterials bom = new OperationHandler<BillOfMaterials>() .setOperation(Daemon.getBillOfMaterials(getVersion())) .setFailureMesssage("Failed to get Bill of Materials for version " + getVersion()) .get(); String result; if (artifactName == null) { AnsiFormatUtils.Format format = GlobalOptions.getGlobalOptions().getOutput(); if (format == null) { format = AnsiFormatUtils.Format.YAML; } result = AnsiFormatUtils.format(format, bom); } else { result = bom.getArtifactVersion(artifactName); } AnsiPrinter.out.println(result); } }
format(nodeDiff, resultBuilder);
format(nodeDiff, resultBuilder);