diff options
-rw-r--r-- | layman/cli.py | 7 | ||||
-rw-r--r-- | layman/constants.py | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/layman/cli.py b/layman/cli.py index 3277c1b..8f94f4a 100644 --- a/layman/cli.py +++ b/layman/cli.py @@ -27,7 +27,8 @@ import os, sys from layman.api import LaymanAPI from layman.utils import (decode_selection, encoder, get_encoding, pad, terminal_width) -from layman.constants import NOT_OFFICIAL_MSG, NOT_SUPPORTED_MSG +from layman.constants import (NOT_OFFICIAL_MSG, NOT_SUPPORTED_MSG, + FAILURE, SUCCEED) @@ -180,9 +181,9 @@ class Main(object): os.umask(old_umask) if not result: - sys.exit(0) + sys.exit(FAILURE) else: - sys.exit(1) + sys.exit(SUCCEED) def Fetch(self): diff --git a/layman/constants.py b/layman/constants.py index 6962867..6f53de3 100644 --- a/layman/constants.py +++ b/layman/constants.py @@ -50,3 +50,6 @@ WARN_LEVEL = 4 INFO_LEVEL = 4 DEBUG_LEVEL = 4 DEBUG_VERBOSITY = 2 + +FAILURE = 1 +SUCCEED = 0 |