From: Felipe Contreras Date: Wed, 30 Dec 2020 17:58:23 GMT Subject: Re: [PATCH v2 1/3] completion: bash: add __git_have_func helper Message-ID: <5fecbfbf46fe5_8775920846@natae.notmuch> In-Reply-To: <5fecbb6b2f9a_871cb208f6@natae.notmuch> Felipe Contreras wrote: > René Scharfe wrote: > > And then I wondered why use declare -f, which prints the function's > > body, when there is -F, which just prints the function's name. And why > > repeat /dev/null when redirecting stderr when the more shorter 2>&1 > > would do the same? None of hat was introduced by you patch, of course. > > Anyway, this seems to work for me: > > > > __git_have_func () { > > case "$1" in > > -*) return 1 ;; > > esac > > declare -F "$1" >/dev/null 2>&1 > > } Actually... How about: declare -F -- "$1" >/dev/null 2>&1 ? -- Felipe Contreras