Add completion to new-session and new-window commands

Complete names of existing sessions and windows for the `new` commands,
enabling easier creation of similarly named layouts.
This commit is contained in:
2012-05-24 00:53:20 +01:00
parent 4477b69f7a
commit 147db787d5
2 changed files with 16 additions and 0 deletions

View File

@@ -2,6 +2,14 @@
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
# Provide tmuxifier completions
if [ "$1" == "--complete" ]; then
for item in $(tmuxifier-list-sessions); do
echo "$item"
done
exit
fi
if [ -z "$1" ]; then
echo "$(tmuxifier-help new-session)" >&2
exit 1

View File

@@ -2,6 +2,14 @@
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
# Provide tmuxifier completions
if [ "$1" == "--complete" ]; then
for item in $(tmuxifier-list-windows); do
echo "$item"
done
exit
fi
if [ -z "$1" ]; then
echo "$(tmuxifier-help new-window)" >&2
exit 1