X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=opt%2Fbin%2Fktmux;h=9545c3618073bdbcfdf08b3d96de7866f7ff664b;hb=83448b47cbb7f713eaa4a4563dc3110973eaaa5e;hp=eb590dae66f1e3931f417264045d45ddeafd1ff2;hpb=d888ac6b277e2ff5feb8610bbdc8ae775cef56e5;p=profile.git diff --git a/opt/bin/ktmux b/opt/bin/ktmux index eb590da..9545c36 100755 --- a/opt/bin/ktmux +++ b/opt/bin/ktmux @@ -1,11 +1,24 @@ #!/bin/bash +# +# ktmux: Start tmux and ktmux_helper. +# Usage: ktmux [options] +# Options: -I Pass path to kinit through to ktmux_helper. +# -L Pass path to klist through to ktmux_helper. +# -R Pass path to krenew through to ktmux_helper. +# -T Path to tmux. +# -n Window name for new tmux session. +# -s Session name for new tmux session. +# -t Target session name for new tmux session. +# tmux=tmux +helper_opts= tmux_opts= session_opts= -while getopts ":T:n:s:t:" opt; do +while getopts ":I:L:R:T:n:s:t:" opt; do case $opt in - T) tmux="$OPTARG";; + I|L|R) helper_opts="$helper_opts -$opt $OPTARG";; + T) tmux="$OPTARG"; helper_opts="$helper_opts -$opt $OPTARG";; n|s|t) session_opts="$session_opts -$opt $OPTARG";; esac done @@ -18,4 +31,4 @@ if [ -z "$KRB5CCNAME" ]; then fi klist -s || kinit -exec $tmux ${tmux_opts## } new-session ${session_opts## } -d ';' set-environment KRB5CCNAME "$KRB5CCNAME" ';' attach ';' run-shell ktmux_helper +exec $tmux ${tmux_opts## } new-session ${session_opts## } -d ';' set-environment KRB5CCNAME "$KRB5CCNAME" ';' attach ';' run-shell "ktmux_helper ${helper_opts## }"