Skip to content

Commit dbe8cac

Browse files
committed
Added ANSI escape sequences as constants
1 parent 1b655e9 commit dbe8cac

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/main/java/de/rub/nds/tlsscanner/Main.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import de.rub.nds.tlsattacker.core.config.delegate.GeneralDelegate;
1414
import de.rub.nds.tlsattacker.core.exceptions.ConfigurationException;
1515
import de.rub.nds.tlsscanner.config.ScannerConfig;
16+
import de.rub.nds.tlsscanner.constants.AnsiEscapeSequence;
1617
import de.rub.nds.tlsscanner.report.SiteReport;
1718
import java.io.IOException;
1819
import org.apache.logging.log4j.LogManager;
@@ -42,9 +43,9 @@ public static void main(String[] args) throws IOException {
4243
LOGGER.info("Performing Scan, this may take some time...");
4344
SiteReport report = scanner.scan();
4445
LOGGER.info("Scanned in:" + ((System.currentTimeMillis()-time)/1000) + "s\n");
45-
// ANSI escape sequences to erase the progressbar
4646
if(!config.getGeneralDelegate().isDebug()){
47-
ConsoleLogger.CONSOLE.info("\033[1A\033[2K");
47+
// ANSI escape sequences to erase the progressbar
48+
ConsoleLogger.CONSOLE.info(AnsiEscapeSequence.ANSI_ONE_LINE_UP + AnsiEscapeSequence.ANSI_ERASE_LINE);
4849
}
4950
ConsoleLogger.CONSOLE.info("Scanned in: " + ((System.currentTimeMillis()-time)/1000) + "s\n" + report.getFullReport(config.getReportDetail()));
5051
} catch (ConfigurationException E) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package de.rub.nds.tlsscanner.constants;
7+
8+
/**
9+
*
10+
* @author Pierre Tilhaus<[email protected]>
11+
*/
12+
public class AnsiEscapeSequence {
13+
14+
public static final String ANSI_ONE_LINE_UP = "\033[1A";
15+
public static final String ANSI_ERASE_LINE = "\033[2K";
16+
}

0 commit comments

Comments
 (0)