 ;;; core/cli/env.el -*- lexical-binding: t; -*-
 
 (defcli! env
-    ((allow      ["-a" "--allow"] "An envvar whitelist regexp")
+    ((allow      ["-a" "--allow" regexp]  "An envvar whitelist regexp")
+     (reject     ["-r" "--reject" regexp] "An envvar blacklist regexp")
      (clear-p    ["-c" "--clear"] "Clear and delete your envvar file")
      (outputfile ["-o" PATH]
     "Generate the envvar file at PATH. Envvar files that aren't in

Each string is a regexp, matched against variable names to omit from
`doom-env-file'.")

(defun doom-cli-reload-env-file (&optional force-p env-file whitelist)
  "Generates `doom-env-file', if it doesn't exist (or if FORCE-P).

This scrapes the variables from your shell environment by running

           (print! (success "Successfully deleted %S")
                   (path env-file)))

          ((and args (not (or allow reject)))
           (user-error "I don't understand 'doom env %s'"
                       (string-join args " ")))

          ((doom-cli-reload-env-file
            'force env-file (list allow) (list reject))))))


;;
;; Helpers

(defvar doom-env-blacklist
  '("^DBUS_SESSION_BUS_ADDRESS$"
    "^GPG_AGENT_INFO$" "^\\(SSH\\|GPG\\)_TTY$"
    "^SSH_\\(AUTH_SOCK\\|AGENT_PID\\)$"
