Add warning message if z.sh is executed instead of sourced.

Closes #74
This commit is contained in:
rupa committed 2013-02-22 15:20:08 -05:00
1 parent 2bdd699beb
commit ca5661cb39
1 file changed
+5
+5
View File
@@ -21,6 +21,11 @@
# * z -t foo # cd to most recently accessed dir matching foo
# * z -l foo # list all dirs matching foo (by frecency)
case $- in
*i*) ;;
*) echo 'ERROR: z.sh is meant to be sourced, not directly executed.'
esac
_z() {
local datafile="${_Z_DATA:-$HOME/.z}"