File tree 1 file changed +26
-0
lines changed
jansi/src/main/java/org/fusesource/jansi
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 23
23
import java .io .IOException ;
24
24
import java .io .InputStream ;
25
25
import java .io .InputStreamReader ;
26
+ import java .io .PrintStream ;
26
27
import java .io .Reader ;
27
28
import java .util .Properties ;
28
29
@@ -90,6 +91,11 @@ public static void main(String... args) throws IOException {
90
91
System .out .println ("Jansi System.err mode: " + AnsiConsole .JANSI_STDERR_TYPE );
91
92
92
93
try {
94
+ System .out .println ();
95
+
96
+ testAnsi (false );
97
+ testAnsi (true );
98
+
93
99
if (args .length == 0 ) {
94
100
printJansiLogoDemo ();
95
101
return ;
@@ -140,6 +146,26 @@ private static void diagnoseTty(boolean stderr) {
140
146
+ (stderr ? "err" : "out" ) + " " + ((isatty == 0 ) ? "is *NOT*" : "is" ) + " a terminal" );
141
147
}
142
148
149
+ private static void testAnsi (boolean stderr ) {
150
+ @ SuppressWarnings ( "resource" )
151
+ PrintStream s = stderr ? System .err : System .out ;
152
+ s .print ("test on System." + (stderr ? "err" : "out" ) + ":" );
153
+ for (Ansi .Color c : Ansi .Color .values ()) {
154
+ s .print (" " + ansi ().fg (c ) + c + ansi ().reset ());
155
+ }
156
+ s .println ();
157
+ s .print (" bright:" );
158
+ for (Ansi .Color c : Ansi .Color .values ()) {
159
+ s .print (" " + ansi ().fgBright (c ) + c + ansi ().reset ());
160
+ }
161
+ s .println ();
162
+ s .print (" bold:" );
163
+ for (Ansi .Color c : Ansi .Color .values ()) {
164
+ s .print (" " + ansi ().bold ().fg (c ) + c + ansi ().reset ());
165
+ }
166
+ s .println ();
167
+ }
168
+
143
169
private static String getPomPropertiesVersion (String path ) throws IOException {
144
170
InputStream in = AnsiMain .class .getResourceAsStream ("/META-INF/maven/" + path + "/pom.properties" );
145
171
if (in == null ) {
You can’t perform that action at this time.
0 commit comments