summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2009-12-03 17:16:01 +0200
committerLars Wirzenius <liw@liw.fi>2009-12-03 17:16:01 +0200
commite48755d4175724db4077610319374674b854c32d (patch)
tree49c61c7c025278c55699f12d804b9f7f2db32a90
parente4da16f64fbd081de70cb9b7ebee6176a402a91b (diff)
downloadobnam-e48755d4175724db4077610319374674b854c32d.tar.gz
Added --store option.
When using --help, the option parser exits the process. Changed the main program to not print the SystemExit exception in this case, just calling sys.exit instead, with the appropriate exit code.
-rwxr-xr-xobnam2
-rw-r--r--obnamlib/app.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/obnam b/obnam
index aaf5b23f..c8845fc7 100755
--- a/obnam
+++ b/obnam
@@ -26,6 +26,8 @@ except obnamlib.AppException, e:
logging.critical(str(e))
sys.stderr.write('Error: %s\n' % str(e))
sys.exit(1)
+except SystemExit, e:
+ sys.exit(e.code)
except BaseException, e:
logging.critical(traceback.format_exc())
sys.stderr.write(traceback.format_exc())
diff --git a/obnamlib/app.py b/obnamlib/app.py
index 76b60daa..a7222ca9 100644
--- a/obnamlib/app.py
+++ b/obnamlib/app.py
@@ -30,6 +30,7 @@ class App(object):
self.config = obnamlib.Configuration([])
self.config.new_string(['log'], 'name of log file')
self.config.log = 'obnam.log'
+ self.config.new_string(['store'], 'name of backup store')
self.pm = obnamlib.PluginManager()
self.pm.locations = [self.plugins_dir()]