From 2f1c856c0460a504216d717fc169ee43795a1bdc Mon Sep 17 00:00:00 2001 From: Prashant Sachdeva Date: Sat, 26 Sep 2015 22:28:06 -0700 Subject: [PATCH] fix status code to reflect success or failure to sync Return value set to 1 if sync failed and error is thrown. Otherwise set to 0 if successful. Signed-off-by: Prashant Sachdeva Signed-off-by: Nicolas Sebrecht --- offlineimap/init.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/offlineimap/init.py b/offlineimap/init.py index 5c90377..761ff61 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -48,7 +48,7 @@ class OfflineImap: if options.diagnostics: self.__serverdiagnostics(options) else: - self.__sync(options) + return self.__sync(options) def __parse_cmd_options(self): parser = OptionParser(version=offlineimap.__bigversion__, @@ -351,11 +351,13 @@ class OfflineImap: offlineimap.mbnames.write(True) self.ui.terminate() + return 0 except (SystemExit): raise except Exception as e: self.ui.error(e) self.ui.terminate() + return 1 def __sync_singlethreaded(self, accs): """Executed if we do not want a separate syncmaster thread