[PATCH] test: cli: getting/setting/removing config values
David Bremner
david at tethera.net
Sat Jan 14 04:16:30 PST 2012
On Sat, 14 Jan 2012 09:57:56 +0100, Pieter Praet <pieter at praet.org> wrote:
> Full test coverage for getting, setting and removing options in
> notmuch(1)'s config file ($NOTMUCH_CONFIG or $HOME/.notmuch-config).
>
> ---
> +
> +# FIXME: Not the most robust nor portable solution here...
> +# Especially `hostname --domain' may have unwanted effects on
> +# some platforms, e.g. setting your hostname to "--domain" ;)
> +fallback_name="$(grep $(id -un) /etc/passwd | cut -d ":" -f 5 | cut -d "," -f 1)"
> +fallback_email="$(id -un)@$(hostname).$(hostname --domain)"
I'm not sure how portable it is, but maybe dnsdomainname would at least
have better failure modes.
I also wondered about using getent instead of grep.
d
More information about the notmuch
mailing list