summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob <jakob@pipefour.org>2012-04-03 11:01:56 -0700
committerJakob <jakob@pipefour.org>2012-04-03 11:01:56 -0700
commit38c07a72c1afa1199fab7d527b5a515ded764c55 (patch)
tree244555f9eb1bc3b976870dc0254e16d9b987c835
parentf91b696b66610d406174dce921fbaf497d0d1971 (diff)
Add notmuch-config switch back in.
The order of overriding is (highest priority first): command-line switch (--notmuch-config) environment variable ($NOTMUCH_CONFIG) default (~/.notmuch-config)
-rwxr-xr-xalot/init.py8
-rw-r--r--docs/source/usage/synopsis.rst2
2 files changed, 6 insertions, 4 deletions
diff --git a/alot/init.py b/alot/init.py
index 7191324c..a9145de8 100755
--- a/alot/init.py
+++ b/alot/init.py
@@ -85,6 +85,7 @@ class Options(usage.Options):
optParameters = [
['config', 'c', None, 'config file'],
+ ['notmuch-config', 'n', None, 'notmuch config'],
['colour-mode', 'C', None, 'terminal colour mode', colourint],
['mailindex-path', 'p', None, 'path to notmuch index'],
['debug-level', 'd', 'info', 'debug log', debuglogstring],
@@ -136,9 +137,10 @@ def main():
configfiles.insert(0, expanded_path)
# locate notmuch config
- notmuchconfig = os.path.expanduser(os.environ.get('NOTMUCH_CONFIG',
- '~/.notmuch-config'))
-
+ notmuchpath = os.environ.get('NOTMUCH_CONFIG', '~/.notmuch-config')
+ if args['notmuch-config']:
+ notmuchpath = args['notmuch-config']
+ notmuchconfig = os.path.expanduser(notmuchpath)
alotconfig = None
# read the first alot config file we find
diff --git a/docs/source/usage/synopsis.rst b/docs/source/usage/synopsis.rst
index 54a61a81..5bfb8e88 100644
--- a/docs/source/usage/synopsis.rst
+++ b/docs/source/usage/synopsis.rst
@@ -8,7 +8,7 @@ Options
-r, --read-only open db in read only mode
-c, --config=FILENAME config file (default: ~/.config/alot/config)
- -n, --notmuch-config=FILENAME notmuch config (default: ~/.notmuch-config)
+ -n, --notmuch-config=FILENAME notmuch config (default: $NOTMUCH_CONFIG or ~/.notmuch-config)
-C, --colour-mode=COLOUR terminal colour mode (default: 256). Must be 1, 16 or 256
-p, --mailindex-path=PATH path to notmuch index
-d, --debug-level=LEVEL debug log (default: info). Must be one of debug,info,warning or error