Copy became script to target directory.
[profile.git] / opt / bin / ktmux
index eb590da..9989842 100755 (executable)
@@ -1,12 +1,27 @@
 #!/bin/bash
+#
+# ktmux: Start tmux and ktmux_helper.
+# Usage: ktmux [options]
+# Options: -I <path>   Pass path to kinit through to ktmux_helper.
+#          -L <path>   Pass path to klist through to ktmux_helper.
+#          -R <path>   Pass path to krenew through to ktmux_helper.
+#          -S <path>   Socket path for tmux.
+#          -T <path>   Path to tmux.
+#          -n <name>   Window name for new tmux session.
+#          -s <name>   Session name for new tmux session.
+#          -t <name>   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:S: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";;
+    S) tmux_opts="$tmux_opts -$opt $OPTARG";;
   esac
 done
 shift $((OPTIND-1))
@@ -18,4 +33,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## }"