3 Commits

11 changed files with 25 additions and 24 deletions

View File

@@ -17,25 +17,25 @@ case "$1" in
"window" | "win" | "w" ) "window" | "win" | "w" )
echo "load-window" echo "load-window"
;; ;;
"new-ses" | "ns" ) "new-ses" | "nses" | "ns" )
echo "new-session" echo "new-session"
;; ;;
"new-win" | "nw" ) "new-win" | "nwin" | "nw" )
echo "new-window" echo "new-window"
;; ;;
"edit-ses" | "es" ) "edit-ses" | "eses" | "es" )
echo "edit-session" echo "edit-session"
;; ;;
"edit-win" | "ew" ) "edit-win" | "ewin" | "ew" )
echo "edit-window" echo "edit-window"
;; ;;
"ls" ) "l" )
echo "list" echo "list"
;; ;;
"list-ses" | "lss" ) "list-ses" | "lses" | "ls" )
echo "list-sessions" echo "list-sessions"
;; ;;
"list-win" | "lsw" ) "list-win" | "lwin" | "lw" )
echo "list-windows" echo "list-windows"
;; ;;
* ) * )

View File

@@ -20,13 +20,12 @@ has-completions() {
grep -i "^# Provide tmuxifier completions" "$1" >/dev/null grep -i "^# Provide tmuxifier completions" "$1" >/dev/null
} }
command="$1" if [ -z "$1" ]; then
if [ -z "$command" ]; then
echo "$(tmuxifier-help completions)" >&2 echo "$(tmuxifier-help completions)" >&2
exit 1 exit 1
fi fi
! command_path="$(tmuxifier-resolve-command-path "$command")" ! command_path="$(tmuxifier-resolve-command-path "$1")"
if [ -n "$command_path" ] && has-completions "$command_path"; then if [ -n "$command_path" ] && has-completions "$command_path"; then
shift shift

View File

@@ -6,7 +6,7 @@ set -e
if [ "$1" == "--help" ]; then if [ "$1" == "--help" ]; then
echo "usage: tmuxifier edit-session <layout_name> echo "usage: tmuxifier edit-session <layout_name>
Aliases: edit-ses, es Aliases: edit-ses, eses, es
Open specified session layout for editing in \$EDITOR." Open specified session layout for editing in \$EDITOR."
exit exit

View File

@@ -6,7 +6,7 @@ set -e
if [ "$1" == "--help" ]; then if [ "$1" == "--help" ]; then
echo "usage: tmuxifier edit-window <layout_name> echo "usage: tmuxifier edit-window <layout_name>
Aliases: edit-win, ew Aliases: edit-win, ewin, ew
Open specified window layout for editing in \$EDITOR." Open specified window layout for editing in \$EDITOR."
exit exit

View File

@@ -19,16 +19,16 @@ has-help() {
} }
command="$1" command="$1"
if [ -z "$command" ]; then if [ -z "$1" ]; then
echo "usage: tmuxifier <command> [<args>] echo "usage: tmuxifier <command> [<args>]
Some useful tmuxifier commands are: Some useful tmuxifier commands are:
<command> <alias> <command> <alias>
load-session s Load the specified session layout. load-session s Load the specified session layout.
load-window w Load the specified window layout into current session. load-window w Load the specified window layout into current session.
list ls List all session and window layouts. list l List all session and window layouts.
list-sessions lss List session layouts. list-sessions ls List session layouts.
list-windows lsw List window layouts. list-windows lw List window layouts.
new-session ns Create new session layout and open it with \$EDITOR. new-session ns Create new session layout and open it with \$EDITOR.
new-window nw Create new window layout and open it with \$EDITOR. new-window nw Create new window layout and open it with \$EDITOR.
edit-session es Edit specified session layout with \$EDITOR. edit-session es Edit specified session layout with \$EDITOR.
@@ -41,10 +41,10 @@ See 'tmuxifier help <command>' for information on a specific command."
exit exit
fi fi
! command_path="$(tmuxifier-resolve-command-path "$command")" ! command_path="$(tmuxifier-resolve-command-path "$1")"
if [ -z "$command_path" ]; then if [ -z "$command_path" ]; then
echo "tmuxifier: no such command '$command'" >&2 echo "tmuxifier: no such command '$1'" >&2
exit 1 exit 1
fi fi
@@ -52,6 +52,8 @@ if has-help "$command_path"; then
shift shift
exec "$command_path" --help "$@" exec "$command_path" --help "$@"
else else
command="$(basename "$command_path")"
command="${command/tmuxifier\-/}"
echo "Sorry, the '$command' command isn't documented yet." echo "Sorry, the '$command' command isn't documented yet."
echo "" echo ""
echo "You can view the command's source here:" echo "You can view the command's source here:"

View File

@@ -6,7 +6,7 @@ set -e
if [ "$1" == "--help" ]; then if [ "$1" == "--help" ]; then
echo "usage: tmuxifier list echo "usage: tmuxifier list
Aliases: ls Aliases: l
List all available session and window layouts." List all available session and window layouts."
exit exit

View File

@@ -6,7 +6,7 @@ set -e
if [ "$1" == "--help" ]; then if [ "$1" == "--help" ]; then
echo "usage: tmuxifier list-sessions echo "usage: tmuxifier list-sessions
Aliases: list-ses, lss Aliases: list-ses, lses, ls
List all session layouts." List all session layouts."
exit exit

View File

@@ -6,7 +6,7 @@ set -e
if [ "$1" == "--help" ]; then if [ "$1" == "--help" ]; then
echo "usage: tmuxifier list-windows echo "usage: tmuxifier list-windows
Aliases: list-win, lsw Aliases: list-win, lwin, lw
List all window layouts." List all window layouts."
exit exit

View File

@@ -6,7 +6,7 @@ set -e
if [ "$1" == "--help" ]; then if [ "$1" == "--help" ]; then
echo "usage: tmuxifier new-session <layout_name> echo "usage: tmuxifier new-session <layout_name>
Aliases: new-ses, ns Aliases: new-ses, nses, ns
Create a new session layout and open it for editing in \$EDITOR." Create a new session layout and open it for editing in \$EDITOR."
exit exit

View File

@@ -6,7 +6,7 @@ set -e
if [ "$1" == "--help" ]; then if [ "$1" == "--help" ]; then
echo "usage: tmuxifier new-window <layout_name> echo "usage: tmuxifier new-window <layout_name>
Aliases: new-win, ws Aliases: new-win, nwin, nw
Create a new window layout and open it for editing in \$EDITOR." Create a new window layout and open it for editing in \$EDITOR."
exit exit

View File

@@ -10,4 +10,4 @@ Outputs Tmuxifier version."
exit exit
fi fi
echo "0.5.1" echo "0.6.0"