mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
* `session` and `window` commands are now know as `load-session` and `load-window` respectively, with aliases for their former names. * Add short aliases for various commands. * `help` and `completions` commands have been expanded with support for aliases. * `help` command has been expanded upon with brief docs for a few more commands.
46 lines
944 B
Bash
Executable File
46 lines
944 B
Bash
Executable File
#! /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/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="$(command -v "tmuxifier-$command" || true)"
|
|
|
|
# Attempt to resolve aliases
|
|
if [ -z $command_path ]; then
|
|
resolved="$(tmuxifier-alias "$command")"
|
|
if [ ! -z "$resolved" ]; then
|
|
command_path="$(command -v "tmuxifier-$resolved" || true)"
|
|
fi
|
|
fi
|
|
|
|
if [ -z "$command_path" ]; then
|
|
echo "tmuxifier: no such command '$command'" >&2
|
|
exit 1
|
|
fi
|
|
|
|
shift 1
|
|
exec "$command_path" "$@"
|
|
;;
|
|
esac
|