madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

enable other commands to be passed
authormartin f. krafft <madduck@madduck.net>
Fri, 27 Mar 2020 18:52:47 +0000 (07:52 +1300)
committermartin f. krafft <madduck@madduck.net>
Fri, 27 Mar 2020 18:52:47 +0000 (07:52 +1300)
.bin/mtmux

index bee0bc80de0922e30e51691a907e72ad6be6c664..0db35e1f3deaa4fb9676a9fba28b03516d2771c4 100755 (executable)
@@ -29,6 +29,7 @@ err() {
   exit $exitcode
 }
 
+cmds=
 for i in "$@"; do
   case "${state:-}:$i" in
     (:-c) state=cwd;;
@@ -49,7 +50,10 @@ for i in "$@"; do
       state=
       ;;
 
-    (:--) shift; set -- "$@"; break
+    (:--) shift; set -- "$@"; break;;
+
+    (:\;) cmds="$cmds \;";;
+    (:*) cmds="${cmds:+$cmds }$i";;
   esac
   shift 2>/dev/null || break
 done
@@ -69,7 +73,7 @@ if [ -n "${window:-}" ]; then
     err 1 "Missing option -n, required with -w"
   fi
 
-  args="new -t $name \; select-window -t $window"
+  args="new -t $name \;${cmds:+ $cmds \;} select-window -t $window"
 
 else
 
@@ -78,9 +82,10 @@ else
     case "$i" in
       (*:) wname="${i%:}";;
       (+|.|\;)
-        args="${args}${subcmd}${cwd:+ -c $cwd}${wname:+ -n $wname}${cmd:-} \\; "
+        args="${args}${subcmd}${cwd:+ -c $cwd}${wname:+ -n $wname}${cmd:-} \; "
+        args="$args${cmds:+$cmds \; }"
         subcmd="neww -d"
-        cmd=
+        cmd= cmds=
         ;;
       (*) cmd="${cmd:-} $i";;
     esac