Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4685a6cf authored by Ramkumar Ramachandra's avatar Ramkumar Ramachandra Committed by Arnaldo Carvalho de Melo
Browse files

perf completion: Strip function_exists ()



Use "type" to check existence consistently.

Signed-off-by: default avatarRamkumar Ramachandra <artagnon@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1372941691-14684-6-git-send-email-artagnon@gmail.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7b6c48e1
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
# perf completion
# perf completion


function_exists()
type __ltrim_colon_completions &>/dev/null ||
{
	declare -F $1 > /dev/null
	return $?
}

function_exists __ltrim_colon_completions ||
__ltrim_colon_completions()
__ltrim_colon_completions()
{
{
	if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then
	if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then