]> git.donarmstrong.com Git - zsh.git/blobdiff - .zsh/func/vcsh
fix use of $0
[zsh.git] / .zsh / func / vcsh
index ca26a9edd78390156bc6981af21b55af7ad07787..655c9ea3290ae06fdb02d25e453468f60a16fa10 100755 (executable)
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-FGIT_BASE="$HOME/.fgits"
+local FGIT_BASE="$HOME/.fgits"
 
 if [ "${1:---help}" = '--help' ] || [ $# -gt 1 ]; then
-  echo "usage: ${0%/*} reponame" >&2
-  echo "usage: ${0%/*} -l" >&2
+  echo "usage: ${0##*/} reponame" >&2
+  echo "usage: ${0##*/} -l" >&2
   [ "$1" = '--help' ]
   return $?
 
@@ -32,10 +32,10 @@ if [ ! -d "$FGIT_BASE/${1}.git" ]; then
 fi
 
 export GIT_DIR="$FGIT_BASE/${1}.git"
-_WORKTREE="$(git config --get core.worktree)"
+local _WORKTREE="$(git config --get core.worktree)"
 export GIT_WORK_TREE="$(readlink -f $GIT_DIR/$_WORKTREE)"
 unset _WORKTREE
 
 git status
 
-PS1="%S{VCSH:$1}%s$PS1" $SHELL -i
+PS1="%S{${0##*/}:$1}%s$PS1" $SHELL -i