     (when (< got expected)
       (error "Expected %d arguments, got %d" expected got))
     (when rest
-      (map-put alist restvar rest))
+      (setf (alist-get restvar alist) rest))
     alist))
 
 (defun doom-cli-get (command)

                 (let ((spec (pop arglist)))
                   (when (eq spec '&optional)
                     (setq spec (pop arglist)))
                   (map-put alist spec arg))
                 (when (null arglist)
                   (throw 'done t)))


;;; -*- lexical-binding: t; no-byte-compile: t; -*-

;; Eagerly load these libraries because we may be in a session that
;; hasn't been fully initialized (e.g. where autoloads files haven't
