You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdesdk/scripts/completions/zsh/_makeobj

31 lines
636 B

#compdef makeobj
local index olddir dir subdir
olddir=$PWD
index="$words[(I)-[fCI]]"
if ! ((index)); then
if [ ! -f Makefile ]; then
if [ -n "$OBJ_SUBDIR" ]; then
dir=$PWD
subdir=.
while [ -n "$dir" -a $dir != '/' -a ! -f $dir/$OBJ_SUBDIR/$subdir/Makefile ]; do
dir=$dir(:h)
subdir=$dir(:t)/$subdir
done
if -f $dir/$OBJ_SUBDIR/$subdir/Makefile; then
cd $dir/$OBJ_SUBDIR/$subdir
fi
elif [ -n "$OBJ_REPLACEMENT" ]; then
dir=$(echo $PWD | sed -e "$OBJ_REPLACEMENT")
if [ -f $dir/Makefile ]; then
cd $dir
fi
fi
fi
fi
_make
cd $olddir