From 90265e70806d02771484632056a76aae9687b65c Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Wed, 17 Aug 2022 13:19:57 +0200 Subject: [PATCH] show exit option for file deletion in red --- commands.go | 4 ++-- translate.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands.go b/commands.go index 968a27f..7190cce 100644 --- a/commands.go +++ b/commands.go @@ -92,7 +92,7 @@ func exit() { s := bufio.NewScanner(os.Stdin) s.Split(bufio.ScanRunes) - fmt.Print(Translate("exit? [y/N]: ")) + fmt.Print(Translate("exit? [%s/%s]: ", "y", "N")) if s.Scan() { text := strings.ToLower(s.Text()) if text == "y" || text == "yes" { @@ -108,7 +108,7 @@ func exit() { s := bufio.NewScanner(os.Stdin) s.Split(bufio.ScanRunes) - fmt.Print(Translate("Delete files? [y/N/c]: ")) + fmt.Print(Translate("Delete files? [%s/%s/%s]: ", ColorRed.Sprint("y"), "n", "C")) if s.Scan() { text := strings.ToLower(s.Text()) if text == "y" || text == "yes" { diff --git a/translate.go b/translate.go index e67f17d..094fff5 100644 --- a/translate.go +++ b/translate.go @@ -23,7 +23,6 @@ var Languages = map[string]map[string]string{ "Total size: %s": "Gesamtgröße: %s", "'%s' could not be found": "'%s' konnte nicht gefunden werden", "Could not delete '%s': %s": "'%s' konnte nicht gelöscht werden: %s", - "Delete files? [y/N/c]: ": "Dateien löschen? [y/N/c]: ", "ambiguous path: %s": "Nicht eindeutiger Pfad: %s", "possible paths:\n%s": "Mögliche Pfade:\n%s", "Commands:": "Befehle:", @@ -33,7 +32,8 @@ var Languages = map[string]map[string]string{ "urm: unmark files for removal": "urm: Entmarkiere Dateien zur Löschung", "exit: delete marked files and exit": "exit: Lösche markierte Dateien und beende Programm", "Use command 'exit' for exiting properly": "Nutze den Befehl 'exit', um das Programm ordnungsgemäß zu beenden", - "exit? [y/N]: ": "Beenden? [y/N]: ", + "Delete files? [%s/%s/%s]: ": "Dateien löschen? [%s/%s/%s]: ", + "exit? [%s/%s]: ": "Beenden? [%s/%s]: ", }, "ja": { "fileCountFormat": "%d個", @@ -47,7 +47,6 @@ var Languages = map[string]map[string]string{ "Total size: %s": "全額: %s", "'%s' could not be found": "「%s」が見つかりませんでした", "Could not delete '%s': %s": "「%s」が削除できませんでした: %s", - "Delete files? [y/N/c]: ": "削除してほしいですか? [y/N/c]: ", "ambiguous path: %s": "あいまいなパス: %s", "possible paths:\n%s": "可能なパス:\n%s", "Commands:": "コマンド:", @@ -57,7 +56,8 @@ var Languages = map[string]map[string]string{ "urm: unmark files for removal": "urm: ファイルに削除のマークを除きます", "exit: delete marked files and exit": "exit: 削除のマークされたファイルを削除して終了", "Use command 'exit' for exiting properly": "「exit」コマンドを使って終了します", - "exit? [y/N]: ": "終了してほしいですか? [y/N]: ", + "Delete files? [%s/%s/%s]: ": "削除してほしいですか? [%s/%s/%s]: ", + "exit? [%s/%s]: ": "終了してほしいですか? [%s/%s]: ", }, }