norgbackup/norg/borg/exit_codes.nim

15 lines
240 B
Nim

import std/enumutils
type
EXIT_CODE* = enum
BORG_SUCCESS = 0
BORG_WARNING = 1
BORG_ERROR = 2
OTHER = 99
proc toExitCode*(i: int): EXIT_CODE =
for code in EXIT_CODE:
if i == ord(code): return code
return OTHER