diff options
author | Jakob <jakob@pipefour.org> | 2012-04-03 11:01:56 -0700 |
---|---|---|
committer | Jakob <jakob@pipefour.org> | 2012-04-03 11:01:56 -0700 |
commit | 38c07a72c1afa1199fab7d527b5a515ded764c55 (patch) | |
tree | 244555f9eb1bc3b976870dc0254e16d9b987c835 | |
parent | f91b696b66610d406174dce921fbaf497d0d1971 (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-x | alot/init.py | 8 | ||||
-rw-r--r-- | docs/source/usage/synopsis.rst | 2 |
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 |