Commits

Axel H. committed 0db584c

Avoid declaring the 'command_exists' function for a one shot use.

  • Participants
  • Parent commits 1a200f8

Comments (0)

Files changed (1)

virtualenvwrapper.sh

 #    (cd "$WORKON_HOME"; find -L . -depth 3 -path '*/bin/activate') | sed 's|^\./||' | sed 's|/bin/activate||' | sort
 }
 
-
-# test if a given command exists
-command_exists () {
-    command -v "$1" &> /dev/null ;
-}
-
 _lsvirtualenv_usage () {
     echo "lsvirtualenv [-blh]"
     echo "  -b -- brief mode"
 lsvirtualenv () {
     
     typeset long_mode=true
-    if command_exists getopts
+    if command -v "getopts" &> /dev/null 
     then
 		# Use getopts when possible
     	OPTIND=1