]> git.sesse.net Git - vlc/blobdiff - extras/analyser/zsh_completion.sh
zsh completion: add all known aliases
[vlc] / extras / analyser / zsh_completion.sh
index aecb55e07455bfd6ebefdd653f433ca230123a22..78cdc723d8d25ae2808b37b0f6320e8ebc8e3aea 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/zsh
+#!/usr/bin/env zsh
 # Helper script to install zsh completion for VLC media player
 # © 2008 Rafaël Carré <funman@videolanorg>
 
@@ -38,6 +38,13 @@ function find_libvlc {
     return 1
 }
 
+function find_libvlccore {
+    for i in $BUILDDIR/src/.libs/libvlccore.$SUFFIX $BUILDDIR/src/libvlccore.$SUFFIX; do
+        test -e $i && LIBVLCCORE=$i && return 0
+    done
+    return 1
+}
+
 while test -z "$LIBVLC"; do
     if ! find_libvlc; then
         /bin/echo -n "Please enter the directory where you built vlc: "
@@ -47,7 +54,11 @@ done
 
 echo "libvlc found !"
 
-LD_LIBRARY_PATH=$BUILDDIR/src/.libs
+if ! find_libvlccore; then
+    /bin/echo -n "libvlccore not found ! Linking will fail !"
+fi
+
+export LD_LIBRARY_PATH=$BUILDDIR/src/.libs
 
 if test -e ../../extras/contrib/config.mak -a ! "`grep HOST ../../extras/contrib/config.mak 2>/dev/null|awk '{print $3}'`" != "$HOST"; then
     echo "contribs found !"
@@ -58,7 +69,7 @@ if test -z "$CXX"; then
     CXX=g++
 fi
 
-ZSH_BUILD="$CXX $CPPFLAGS $CXXFLAGS -D__LIBVLC__ -DHAVE_CONFIG_H -I$BUILDDIR -I$BUILDDIR/include -I../../include zsh.cpp $LIBVLC -o zsh_gen"
+ZSH_BUILD="$CXX $CPPFLAGS $CXXFLAGS -D__LIBVLC__ -DHAVE_CONFIG_H -I$BUILDDIR -I$BUILDDIR/include -I../../include zsh.cpp $LIBVLC $LIBVLCCORE -o zsh_gen"
 
 echo "Building zsh completion generator ...  "
 echo $ZSH_BUILD
@@ -103,5 +114,6 @@ read i
 echo "Installing completion ..."
 sudo sh -c "chown 0:0 _vlc && chmod 0644 _vlc && mv _vlc $ZSH_FPATH" || exit 1
 
-echo "zsh completion for VLC successfully installed :)
-Restart running zsh instances, or run \"compinit\" to start using it."
+echo "zsh completion for VLC successfully installed :)"
+echo "Restart running zsh instances after removing ~/.zcompdump, or"
+echo "run \"compinit\" to start using it."