          (progress-reporter))
     (if (seq-empty-p files)
         (setq script template)
-      (if (dwim-shell-command--contains-multi-file-refs template)
+      (if (dwim-shell-command--contains-multi-file-ref template)
           (setq script (dwim-shell-command--expand-files-template template files post-process-template gen-temp-dir))
         (seq-do (lambda (file)
                   (setq script

        ((string-match "\<\<e\>\>" template)
         "<<e>>")))

(defun dwim-shell-command--contains-multi-file-refs (template)
  "Check for <<*>> in TEMPLATE."
  (when (string-match "\<\<\\*\>\>" template)
    "<<*>>"))

Use POST-PROCESS-TEMPLATE to further expand template given own logic.

Set TEMP-DIR to a unique temp directory to this template."
  (cl-assert (not (and (dwim-shell-command--contains-multi-file-ref template)
                       (dwim-shell-command--contains-single-file-ref template)))
             nil "Must not have %s and %s in the same template"
             (dwim-shell-command--contains-multi-file-ref template)
             (dwim-shell-command--contains-single-file-ref template))
  (setq files (seq-map (lambda (file)
                         (expand-file-name file))
