Add documentation comments to exit
This commit is contained in:
parent
c824df3cb2
commit
7a629ccb41
@ -4,6 +4,7 @@ import (
|
|||||||
"gitlab.com/CRThaze/cworthy/errno"
|
"gitlab.com/CRThaze/cworthy/errno"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ExitT represents an unsigned 16 bit integer used to define exit statuses.
|
||||||
type ExitT errno.ErrorT
|
type ExitT errno.ErrorT
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -51,10 +52,14 @@ func init() {
|
|||||||
exitDescs[EX_ABORT] = "process aborted"
|
exitDescs[EX_ABORT] = "process aborted"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Desc returns the description string for a given ExitCode.
|
||||||
func (e ExitT) Desc() string {
|
func (e ExitT) Desc() string {
|
||||||
return exitDescs[e]
|
return exitDescs[e]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetAllExitCodeDescriptions returns an array of all possible ExitCode description
|
||||||
|
// strings (where the index is the exit code). Any unreserved ExitCodes are also
|
||||||
|
// included with empty string descriptions.
|
||||||
func GetAllExitCodeDescriptions() [^ExitT(0)]string {
|
func GetAllExitCodeDescriptions() [^ExitT(0)]string {
|
||||||
return exitDescs
|
return exitDescs
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user