Rename --drop-ansi to --no-ansi

This commit is contained in:
Karlatemp 2020-09-11 20:35:36 +08:00
parent afed2e1de3
commit 9e9c848596
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8
3 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ public object ConsolePureSettings {
var noConsole: Boolean = false
@JvmField
var dropAnsi = false
var noAnsi = false
@JvmField
var noConsoleSafeReading = false

View File

@ -65,7 +65,7 @@ object MiraiConsolePureLoader {
"--no-console" to "使用无终端操作环境",
"--dont-setup-terminal-ansi" to
"[NoConsole] [Windows Only] 不进行ansi console初始化工作",
"--drop-ansi" to "[NoConsole] 禁用 ansi",
"--no-ansi" to "[NoConsole] 禁用 ansi",
"--safe-reading" to
"[NoConsole] 如果启动此选项, console在获取用户输入的时候会获得一个安全的空字符串\n" +
" 如果不启动, 将会直接 error",
@ -109,8 +109,8 @@ object MiraiConsolePureLoader {
"--dont-setup-terminal-ansi" -> {
ConsolePureSettings.setupAnsi = false
}
"--drop-ansi" -> {
ConsolePureSettings.dropAnsi = true
"--no-ansi" -> {
ConsolePureSettings.noAnsi = true
ConsolePureSettings.setupAnsi = false
}
"--safe-reading" -> {

View File

@ -97,7 +97,7 @@ internal object AllEmptyLineReader : LineReader {
override fun printAbove(str: String?) {
if (str == null) return
if (ConsolePureSettings.dropAnsi) {
if (ConsolePureSettings.noAnsi) {
SystemOutputPrintStream.println(ANSI_REGEX.replace(str, ""))
} else SystemOutputPrintStream.println(str)
}