From 055a7ef6a9d668d4c82e7542526474d18bb63987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Wed, 14 Jan 2015 10:45:04 +0800 Subject: [PATCH] Arg fool proof --- bash/bashrc/sources/41_pivot-command | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bash/bashrc/sources/41_pivot-command b/bash/bashrc/sources/41_pivot-command index c095c78..10559a4 100644 --- a/bash/bashrc/sources/41_pivot-command +++ b/bash/bashrc/sources/41_pivot-command @@ -29,6 +29,12 @@ function pvt() { ;; esac + if [[ -z "$ARG3" ]]; then + >&2 echo "Error: LAND_DIR is not defined" + pvt + return 1 + fi + IFS="/" read -a PWDA <<< "$(pwd)" # Begin finding dirs in up-stack