#! /usr/bin/env bash set -e [ -n "$TMUXIFIER_DEBUG" ] && set -x if [ -z "${TMUXIFIER}" ]; then export TMUXIFIER="${HOME}/.tmuxifier" else export TMUXIFIER="${TMUXIFIER%/}" fi # Load tmuxifier environment variables. source "$TMUXIFIER/lib/env.sh" export PATH="$TMUXIFIER/libexec:$PATH" command="$1" case "$command" in "" | "-h" | "--help" ) echo -e "tmuxifier $(tmuxifier-version)\n$(tmuxifier-help)" >&2 ;; "-v" | "--version" ) tmuxifier-version ;; * ) ! command_path="$(tmuxifier-resolve-command-path "$command")" if [ -z "$command_path" ]; then echo "tmuxifier: no such command '$command'" >&2 exit 1 fi shift 1 exec "$command_path" "$@" ;; esac