refactor: rename display exit code

This commit is contained in:
Jan De Dobbeleer 2020-09-30 11:18:35 +02:00 committed by Jan De Dobbeleer
parent c0aa27a342
commit 71c610aaa8
7 changed files with 9 additions and 9 deletions

View file

@ -92,7 +92,7 @@
"trailing_diamond": "", "trailing_diamond": "",
"properties": { "properties": {
"error_icon": "", "error_icon": "",
"display_error_code": false, "display_exit_code": false,
"always_enabled": true, "always_enabled": true,
"error_color": "#e91e63", "error_color": "#e91e63",
"color_background": true, "color_background": true,

View file

@ -37,7 +37,7 @@
"foreground": "#DCB977", "foreground": "#DCB977",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false "display_exit_code": false
} }
}, },
{ {

View file

@ -38,7 +38,7 @@
"foreground": "#DCB977", "foreground": "#DCB977",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false "display_exit_code": false
} }
} }
] ]

View file

@ -96,7 +96,7 @@
"error_icon": "", "error_icon": "",
"always_enabled": true, "always_enabled": true,
"error_color": "#FF5252", "error_color": "#FF5252",
"display_error_code": false "display_exit_code": false
} }
} }
] ]

View file

@ -38,7 +38,7 @@
"foreground": "#DCB977", "foreground": "#DCB977",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false "display_exit_code": false
} }
} }
] ]

View file

@ -50,7 +50,7 @@
"foreground": "#DCB977", "foreground": "#DCB977",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false, "display_exit_code": false,
"postfix": "" "postfix": ""
} }
} }

View file

@ -10,8 +10,8 @@ type exit struct {
const ( const (
//ErrorIcon represents icon to display in case of error //ErrorIcon represents icon to display in case of error
ErrorIcon Property = "error_icon" ErrorIcon Property = "error_icon"
//DisplayErrorCode shows or hides the error code //DisplayExitCode shows or hides the error code
DisplayErrorCode Property = "display_error_code" DisplayExitCode Property = "display_exit_code"
//AlwaysEnabled decides whether or not to always display the exitcode info //AlwaysEnabled decides whether or not to always display the exitcode info
AlwaysEnabled Property = "always_enabled" AlwaysEnabled Property = "always_enabled"
//ErrorColor specify a different foreground color for the error text when using always_show = true //ErrorColor specify a different foreground color for the error text when using always_show = true
@ -48,7 +48,7 @@ func (e *exit) getFormattedText() string {
} }
func (e *exit) getMeaningFromExitCode() string { func (e *exit) getMeaningFromExitCode() string {
if !e.props.getBool(DisplayErrorCode, true) { if !e.props.getBool(DisplayExitCode, true) {
return "" return ""
} }
switch e.env.lastErrorCode() { switch e.env.lastErrorCode() {