     (progress-reporter-update reporter))
   (comint-output-filter process string))
 
-(defun dwim-shell-command--on-marked-files (script name utils &optional post-process-template on-completion)
+(cl-defun dwim-shell-command--on-marked-files (buffer-name script &key check-utils check-extensions post-process-template on-completion)
   "Execute SCRIPT, using buffer NAME, FILES, and bin UTILS."
-  (dwim-shell-command-execute-script script name (dwim-shell-command--marked-files) utils
-                                     post-process-template on-completion))
+  (dwim-shell-command-execute-script buffer-name script
+                                     :files (dwim-shell-command--marked-files)
+                                     :check-utils check-utils
+                                     :check-extensions check-extensions
+                                     :post-process-template post-process-template
+                                     :on-completion on-completion))
 
 (defun dwim-shell-command--marked-files ()
   "Return buffer file (if available) or marked files for a `dired' buffer."

  (let ((factor (string-to-number
                 (completing-read "Speed up x times: " '("1" "1.5" "2" "2.5" "3" "4")))))
    (dwim-shell-command--on-marked-files
     (format "gifsicle -U <<f>> <<frames>> -O2 -o <<fne>>_x%s.<<e>>" factor)
     "Speed up gif" '("gifsicle" "identify")
     (lambda (script file)
       (string-replace "<<frames>>" (dwim-shell-command--gifsicle-frames-every factor file) script)))))

(defun dwim-shell-command-pdf-password-protect ()
  "Speeds up gif(s)."
  (interactive)
  (dwim-shell-command--on-marked-files
   (format "qpdf --verbose --encrypt '%s' '%s' 256 -- <<f>> <<fne>>_enc.<<e>>"
           (read-passwd "user-password: ")
           (read-passwd "owner-password: "))
   "Password protect pdf" '("qpdf")))

(defun dwim-shell-command--gifsicle-frames-every (skipping-every file)
  (string-join

    (seq-do (lambda (util)
              (cl-assert (executable-find util) nil
                         (format "%s not installed" util)))
            check-utils)
    (with-current-buffer proc-buffer
      (require 'shell)
      (shell-mode))
