From: Richard Hartmann Date: Sat, 3 Dec 2011 01:44:16 +0000 (+0100) Subject: Make `vcsh ` a shortcut for `vcsh enter ` X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/28ba04630a336adaf29c1e3206473d7848b5ac13 Make `vcsh ` a shortcut for `vcsh enter ` --- diff --git a/vcsh b/vcsh index 60bcc41..1d38101 100755 --- a/vcsh +++ b/vcsh @@ -211,13 +211,18 @@ elif [ "$1" = 'delete' ] || elif [ "$1" = 'list' ] || [ "$1" = 'list-tracked' ]; then export VCSH_COMMAND="$1" -elif [ -n "$1" ]; then - export VCSH_COMMAND=run +elif [ -n "$1" -a -n "$2" ]; then + export VCSH_COMMAND='run' export VCSH_REPO_NAME="$1" export GIT_DIR="$VCSH_BASE/$VCSH_REPO_NAME.git" [ -d $GIT_DIR ] || { help; exit 1; } shift 1 export VCSH_EXTERNAL_COMMAND="git $*" +elif [ -n "$1" ]; then + export VCSH_COMMAND='enter' + export VCSH_REPO_NAME="$1" + export GIT_DIR="$VCSH_BASE/$VCSH_REPO_NAME.git" + [ -d $GIT_DIR ] || { help; exit 1; } else # $1 is empty, or 'help' help && exit