notmuch-addrlookup-c
notmuch-addrlookup-c copied to clipboard
Respect notmuch-config(1) FILES specs.
WIP
Questions and comments:
- I would make
--configsupersede any environment variables (the same as the notmuch command itself) - To actually conform to the specs, I'd need to check at each stage whether the file actually exists and go to the next one if it doesn't, otherwise we'll never get to
$HOME/.notmuch-config. I did a quick search of how you do this in C, but as there are multiple ways and nothing really popped out as appropriate, what do you prefer for that? In the end I need a function that returns a true or false :) - I'd probably add a
G_OPTION_ARG_NONEtype--debugflag which prints which config file / database is actually used in the end, or maybe at that point maybe the "check file exists" func could print each file it tries, otherwise I think it might get confusing if things don't work as expected.
Thanks for the followup! It is indeed just half-done. Could you also check my question about the config override and the debug flag?
Thanks for the followup! It is indeed just half-done. Could you also check my question about the config override and the debug flag?
My two cents:
- Yes, it makes sense that
--configis more important and takes precedence. - I think we do not need a
--debugoption, you can use g_debug() and by default debug messages are not shown, and setting e.g.G_MESSAGES_DEBUG=allin the environment can then be used to have them shown. As a bonus, GLib will handle adding timestamps, process identifier, and a few other goodies.
perfect, I'll likely take a week or two to follow up