Пример #1
0
 public char[] askSecret(final String question) {
   if (withColor) {
     write(
         console,
         false,
         Ansi.ansi()
             .fgBright(Ansi.Color.CYAN)
             .bold()
             .a(question + " ")
             .boldOff()
             .reset()
             .toString());
   } else {
     write(console, false, question + " ");
   }
   return System.console().readPassword();
 }
Пример #2
0
 public String ask(final String question) {
   if (withColor) {
     write(
         console,
         false,
         Ansi.ansi()
             .fgBright(Ansi.Color.WHITE)
             .bold()
             .a(question + " ")
             .boldOff()
             .reset()
             .toString());
   } else {
     write(console, false, question + " ");
   }
   return System.console().readLine();
 }
Пример #3
0
 public void log(final String value) {
   if (withLog) {
     write(console, true, withColor ? inColor(Color.YELLOW, value) : value);
   }
 }
Пример #4
0
 public void show(final String... values) {
   write(console, true, values);
 }
Пример #5
0
 public void error(final String value) {
   write(console, true, withColor ? inColor(Color.RED, value) : value);
 }
Пример #6
0
 public void log(final char[] value, final int len) {
   if (withLog) {
     final String msg = new String(value, 0, len);
     write(console, false, withColor ? inColor(Color.YELLOW, msg) : msg);
   }
 }