- export GIT_DIR="$VCSH_BASE/$VCSH_REPO_NAME.git"
-elif [ "$1" = 'delete' ] ||
- [ "$1" = 'enter' ] ||
- [ "$1" = 'init' ] ||
- [ "$1" = 'run' ] ||
- [ "$1" = 'seed-gitignore' ] ||
- [ "$1" = 'setup' ]; then
- [ -z $2 ] && fatal "$1: please specify repository to work on" 1
- [ "$1" = 'run' -a -z "$3" ] && fatal "$1: please specify a command" 1
- export VCSH_COMMAND="$1"
+ export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
+elif [ "$VCSH_COMMAND" = 'version' ]; then
+ echo "$SELF $VERSION"
+ exit
+elif [ "$VCSH_COMMAND" = 'which' ]; then
+ [ -z "$2" ] && fatal "$VCSH_COMMAND: please specify a filename" 1
+ [ -n "$3" ] && fatal "$VCSH_COMMAND: too many parameters" 1
+ export VCSH_COMMAND_PARAMETER="$2"
+elif [ "$VCSH_COMMAND" = 'delete' ] ||
+ [ "$VCSH_COMMAND" = 'enter' ] ||
+ [ "$VCSH_COMMAND" = 'init' ] ||
+ [ "$VCSH_COMMAND" = 'list-tracked-by' ] ||
+ [ "$VCSH_COMMAND" = 'rename' ] ||
+ [ "$VCSH_COMMAND" = 'run' ] ||
+ [ "$VCSH_COMMAND" = 'upgrade' ] ||
+ [ "$VCSH_COMMAND" = 'write-gitignore' ]; then
+ [ -z $2 ] && fatal "$VCSH_COMMAND: please specify repository to work on" 1
+ [ "$VCSH_COMMAND" = 'rename' -a -z "$3" ] && fatal "$VCSH_COMMAND: please specify a target name" 1
+ [ "$VCSH_COMMAND" = 'run' -a -z "$3" ] && fatal "$VCSH_COMMAND: please specify a command" 1
+ export VCSH_REPO_NAME="$2"
+ export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
+ [ "$VCSH_COMMAND" = 'rename' ] && { export VCSH_REPO_NAME_NEW="$3";
+ export GIT_DIR_NEW="$VCSH_REPO_D/$VCSH_REPO_NAME_NEW.git"; }
+ [ "$VCSH_COMMAND" = 'run' ] && shift 2
+elif [ "$VCSH_COMMAND" = 'commit' ] ||
+ [ "$VCSH_COMMAND" = 'list' ] ||
+ [ "$VCSH_COMMAND" = 'list-tracked' ] ||
+ [ "$VCSH_COMMAND" = 'pull' ] ||
+ [ "$VCSH_COMMAND" = 'push' ]; then
+ :
+elif [ "$VCSH_COMMAND" = 'status' ]; then