Skip to content

Commit

Permalink
fix(cli): List remediations on STDERR (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwander authored May 9, 2017
1 parent 0575706 commit 4a622eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private static void formatProblemSet(ProblemSet problemSet) {

if (options != null && !options.isEmpty()) {
AnsiUi.remediation("Options include: ");
options.forEach(AnsiUi::listItem);
options.forEach(AnsiUi::listRemediation);
}

// Newline between errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ public static void remediation(String message) {
AnsiPrinter.err.println(builder.toString());
}

public static void listRemediation(String message) {
AnsiParagraphBuilder builder = new AnsiParagraphBuilder()
.setIndentFirstLine(false)
.setIndentWidth(4);

builder.addSnippet(" - ")
.addStyle(AnsiStyle.BOLD);

builder.addSnippet(message);

AnsiPrinter.err.println(builder.toString());
}

public static void success(String message) {
AnsiParagraphBuilder builder = new AnsiParagraphBuilder()
.setIndentFirstLine(false)
Expand Down

0 comments on commit 4a622eb

Please sign in to comment.