(defun my/dwim-shell-command/0x0-upload () "Upload the marked files to 0x0.st" (interactive) (let ((url "https://0x0.st")) (dwim-shell-command-on-marked-files "0x0 upload" (format "curl -Ffile=@<> -Fsecret= %s" url) :utils "curl" :post-process-template ;; Insert the single quotes at the appropriate place according to ;; 0x0.st example online: ;; curl -F'file=@yourfile.png' -Fsecret= https://0x0.st ;; ;; The placement of these single quotes confuse the escaping ;; mechanisms of dwim-shell-command, as it considers @ as the ;; opening 'quote' as it appears right in front of <>. (lambda (template path) (string-replace "-Ffile" "-F'file" (string-replace path (concat path "'") template))))))