|
|
@ -6,6 +6,8 @@ import java.util.Scanner; |
|
|
|
|
|
|
|
public class Cli { |
|
|
|
|
|
|
|
private boolean isClearConsoleActive = true; |
|
|
|
|
|
|
|
private PrintStream printStream; |
|
|
|
private InputStream inputStream; |
|
|
|
private Scanner scanner; |
|
|
@ -14,6 +16,7 @@ public class Cli { |
|
|
|
this.printStream = printStream; |
|
|
|
this.inputStream = inputStream; |
|
|
|
this.scanner = new Scanner(inputStream); |
|
|
|
isClearConsoleActive = true; |
|
|
|
} |
|
|
|
|
|
|
|
public PrintStream getPrintStream() { |
|
|
@ -25,6 +28,8 @@ public class Cli { |
|
|
|
} |
|
|
|
|
|
|
|
public void clearConsole(){ |
|
|
|
if(!isClearConsoleActive) |
|
|
|
return; |
|
|
|
try{ |
|
|
|
String operatingSystem = System.getProperty("os.name");//Check the current operating system |
|
|
|
|
|
|
@ -42,4 +47,9 @@ public class Cli { |
|
|
|
this.getPrintStream().println(e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void setClearConsoleActive(boolean clearConsoleActive) { |
|
|
|
isClearConsoleActive = clearConsoleActive; |
|
|
|
} |
|
|
|
|
|
|
|
} |