zsh-users
 help / color / mirror / code / Atom feed
* equivalent of "if (( $+commands[FOO] ))" for functions?
@ 2012-08-06 22:13 TjL
  2012-08-06 22:36 ` Frank Terbeck
  2012-08-06 22:38 ` Benjamin R. Haskell
  0 siblings, 2 replies; 5+ messages in thread
From: TjL @ 2012-08-06 22:13 UTC (permalink / raw)
  To: Zsh Users

I only recently learned about this method of taking some action only
if the command 'FOO' is found:

	if (( $+commands[FOO] ))
	then

	# take actions

	fi

but what I am wondering is: is there a way to have this same sort of
check, except that it also includes zsh functions/aliases?

If yes, what's the syntax for that?

Otherwise I'll keep using 'which' and sending the output to /dev/null
but I figured it was worth asking.

Thanks!

TjL


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-07 13:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06 22:13 equivalent of "if (( $+commands[FOO] ))" for functions? TjL
2012-08-06 22:36 ` Frank Terbeck
2012-08-06 22:38 ` Benjamin R. Haskell
2012-08-06 23:12   ` TjL
2012-08-07 13:17     ` Benjamin R. Haskell

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).