From e6a99c5a5261af52ee2216175266cbf40cbc6929 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Fri, 31 Mar 2023 21:02:39 +0200 Subject: [PATCH] =?UTF-8?q?feat(exit):=20add=20exit=20codes=2064=C2=AD?= =?UTF-8?q?=C2=AD=E2=80=9378?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolves #3658 --- src/segments/exit.go | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/segments/exit.go b/src/segments/exit.go index a0c6219c..e5c06e41 100644 --- a/src/segments/exit.go +++ b/src/segments/exit.go @@ -31,14 +31,40 @@ func (e *Exit) Init(props properties.Properties, env platform.Environment) { e.env = env } -func (e *Exit) getMeaningFromExitCode(code int) string { +func (e *Exit) getMeaningFromExitCode(code int) string { //nolint: gocyclo switch code { case 1: return "ERROR" - case 2: + case 2, 64: return "USAGE" - case 126: + case 65: + return "DATAERR" + case 66: + return "NOINPUT" + case 67: + return "NOUSER" + case 68: + return "NOHOST" + case 69: + return "UNAVAILABLE" + case 70: + return "SOFTWARE" + case 71: + return "OSERR" + case 72: + return "OSFILE" + case 73: + return "CANTCREAT" + case 74: + return "IOERR" + case 75: + return "TEMPFAIL" + case 76: + return "PROTOCOL" + case 77, 126: return "NOPERM" + case 78: + return "CONFIG" case 127: return "NOTFOUND" case 128 + 1: