cli: move config open/close to main() from subcommands
authorJani Nikula <jani@nikula.org>
Sun, 3 Mar 2013 21:55:09 +0000 (23:55 +0200)
committerDavid Bremner <bremner@debian.org>
Fri, 8 Mar 2013 11:54:41 +0000 (07:54 -0400)
commit4ef2106792439f5ade157b3ba3b8f7fa86fcb3ed
tree892c4e1a8826b324eea1492d19b156b46ae95a06
parente76f6517de020783d828be59f461f1d4f465c4b4
cli: move config open/close to main() from subcommands

This allows specifying config file as a top level argument to notmuch,
and generally makes it possible to override config file options in
main(), without having to touch the subcommands.

If the config file does not exist, one will be created for the notmuch
main command and setup and help subcommands. Help is special in this
regard; the config is created just to avoid errors about missing
config, but it will not be saved.

This also makes notmuch config the talloc context for subcommands.
12 files changed:
notmuch-client.h
notmuch-config.c
notmuch-count.c
notmuch-dump.c
notmuch-new.c
notmuch-reply.c
notmuch-restore.c
notmuch-search.c
notmuch-setup.c
notmuch-show.c
notmuch-tag.c
notmuch.c