Skip to content

Commit 8f171e0

Browse files
authored
Colorize the dialog fatal error messages (#2305)
1 parent 4ffde69 commit 8f171e0

13 files changed

+30
-30
lines changed

.scripts/menu_add_app.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ menu_add_app() {
120120
;;
121121
*)
122122
if [[ -n ${DIALOG_BUTTONS[YesNoDialogButtonPressed]-} ]]; then
123-
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[YesNoDialogButtonPressed]}${NC}' pressed in ${FUNCNAME[0]}."
123+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[YesNoDialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
124124
else
125-
fatal "Unexpected dialog button value '${F[C]}${YesNoDialogButtonPressed}${NC}' pressed in ${FUNCNAME[0]}."
125+
fatal "Unexpected dialog button value '${F[C]}${YesNoDialogButtonPressed}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
126126
fi
127127
;;
128128
esac
@@ -133,9 +133,9 @@ menu_add_app() {
133133
;;
134134
*)
135135
if [[ -n ${DIALOG_BUTTONS[InputValueDialogButtonPressed]-} ]]; then
136-
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[InputValueDialogButtonPressed]}${NC}' pressed in ${FUNCNAME[0]}."
136+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[InputValueDialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
137137
else
138-
fatal "Unexpected dialog button value '${F[C]}${InputValueDialogButtonPressed}${NC}' pressed in ${FUNCNAME[0]}."
138+
fatal "Unexpected dialog button value '${F[C]}${InputValueDialogButtonPressed}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
139139
fi
140140
;;
141141
esac

.scripts/menu_add_var.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ menu_add_var() {
372372
;;
373373
*)
374374
if [[ -n ${DIALOG_BUTTONS[InputValueDialogButtonPressed]-} ]]; then
375-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[InputValueDialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
375+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[InputValueDialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
376376
else
377-
fatal "Unexpected dialog button value '${InputValueDialogButtonPressed}' pressed in ${FUNCNAME[0]}."
377+
fatal "Unexpected dialog button value '${F[C]}${InputValueDialogButtonPressed}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
378378
fi
379379
;;
380380
esac

.scripts/menu_app_select.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ menu_app_select() {
247247
;;
248248
*)
249249
if [[ -n ${DIALOG_BUTTONS[SelectedAppsDialogButtonPressed]-} ]]; then
250-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[SelectedAppsDialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
250+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[SelectedAppsDialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
251251
else
252-
fatal "Unexpected dialog button value '${SelectedAppsDialogButtonPressed}' pressed in ${FUNCNAME[0]}."
252+
fatal "Unexpected dialog button value '${SelectedAppsDialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
253253
fi
254254
;;
255255
esac

.scripts/menu_config.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ menu_config() {
105105
;;
106106
*)
107107
if [[ -n ${DIALOG_BUTTONS[YesNoDialogButtonPressed]-} ]]; then
108-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[YesNoDialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
108+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[YesNoDialogButtonPressed]}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
109109
else
110-
fatal "Unexpected dialog button value '${YesNoDialogButtonPressed}' pressed in ${FUNCNAME[0]}."
110+
fatal "Unexpected dialog button value '${YesNoDialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
111111
fi
112112
;;
113113
esac
@@ -128,9 +128,9 @@ menu_config() {
128128
;;
129129
*)
130130
if [[ -n ${DIALOG_BUTTONS[ConfigDialogButtonPressed]-} ]]; then
131-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[ConfigDialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
131+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[ConfigDialogButtonPressed]}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
132132
else
133-
fatal "Unexpected dialog button value '${ConfigDialogButtonPressed}' pressed in ${FUNCNAME[0]}."
133+
fatal "Unexpected dialog button value '${ConfigDialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
134134
fi
135135
;;
136136
esac

.scripts/menu_config_apps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ menu_config_apps() {
9797
;;
9898
*)
9999
if [[ -n ${DIALOG_BUTTONS[AppChoiceButtonPressed]-} ]]; then
100-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[AppChoiceButtonPressed]}' pressed in ${FUNCNAME[0]}."
100+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[AppChoiceButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
101101
else
102-
fatal "Unexpected dialog button value '${AppChoiceButtonPressed}' pressed in ${FUNCNAME[0]}."
102+
fatal "Unexpected dialog button value '${AppChoiceButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
103103
fi
104104
;;
105105
esac

.scripts/menu_config_vars.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ menu_config_vars() {
233233
;;
234234
*)
235235
if [[ -n ${DIALOG_BUTTONS[LineDialogButtonPressed]-} ]]; then
236-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[LineDialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
236+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[LineDialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
237237
else
238-
fatal "Unexpected dialog button value '${LineDialogButtonPressed}' pressed in ${FUNCNAME[0]}."
238+
fatal "Unexpected dialog button value '${LineDialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
239239
fi
240240
;;
241241
esac

.scripts/menu_main.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ menu_main() {
6060
;;
6161
*)
6262
if [[ -n ${DIALOG_BUTTONS[MainDialogButtonPressed]-} ]]; then
63-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[MainDialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
63+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[MainDialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
6464
else
65-
fatal "Unexpected dialog button value '${MainDialogButtonPressed}' pressed in ${FUNCNAME[0]}."
65+
fatal "Unexpected dialog button value '${MainDialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
6666
fi
6767
;;
6868
esac

.scripts/menu_options.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ menu_options() {
5858
;;
5959
*)
6060
if [[ -n ${DIALOG_BUTTONS[DialogButtonPressed]-} ]]; then
61-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[DialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
61+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[DialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
6262
else
63-
fatal "Unexpected dialog button value '${DialogButtonPressed}' pressed in ${FUNCNAME[0]}."
63+
fatal "Unexpected dialog button value '${F[C]}${DialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
6464
fi
6565
;;
6666
esac

.scripts/menu_options_display.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ menu_options_display() {
8282
;;
8383
*)
8484
if [[ -n ${DIALOG_BUTTONS[DialogButtonPressed]-} ]]; then
85-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[DialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
85+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[DialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
8686
else
87-
fatal "Unexpected dialog button value '${DialogButtonPressed}' pressed in ${FUNCNAME[0]}."
87+
fatal "Unexpected dialog button value '${F[C]}${DialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
8888
fi
8989
;;
9090
esac

.scripts/menu_options_package_manager.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ menu_options_package_manager() {
7676
;;
7777
*)
7878
if [[ -n ${DIALOG_BUTTONS[DialogButtonPressed]-} ]]; then
79-
fatal "Unexpected dialog button '${DIALOG_BUTTONS[DialogButtonPressed]}' pressed in ${FUNCNAME[0]}."
79+
fatal "Unexpected dialog button '${F[C]}${DIALOG_BUTTONS[DialogButtonPressed]}${NC}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
8080
else
81-
fatal "Unexpected dialog button value '${DialogButtonPressed}' pressed in ${FUNCNAME[0]}."
81+
fatal "Unexpected dialog button value '${F[C]}${DialogButtonPressed}' pressed in '${C["RunningCommand"]-}${FUNCNAME[0]}${NC}'."
8282
fi
8383
;;
8484
esac

0 commit comments

Comments
 (0)