Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.1.2
-
Fix Version/s: None
-
Component/s: karaf
-
Labels:None
Description
Currently we have two bad things in our commands. First is System.out.println() mix with getConsole().println()
Second thing is jansi usage. It is really cool to have colour output under Windows/Unix shell but printing something with this library is a little hard. Fluent api in this case is not the best choice:
String str = Ansi.ansi()
.fg(Ansi.Color.RED)
.a("Command not found: ")
.a(Ansi.Attribute.INTENSITY_BOLD)
.a(((CommandNotFoundException) t).getCommand())
.a(Ansi.Attribute.INTENSITY_BOLD_OFF)
.fg(Ansi.Color.DEFAULT).toString();
Instead of simple string tags:
String str = new Ansi("[red]Command not found: [bold]" + ((CommandNotFoundException) t).getCommand() + "[/bold][/red]).toString();
These two things are releated because we can simply wrap getConsole().println() with jansi but System.out.println not.