feat(cli): add -l/--load switch

Post-rewrite bin/doom will accept multiple -l's, but for now will only
accept one. This change was made to prepare for the documentation
generator, which will live outside the repo.
This commit is contained in:
Henrik Lissner 2021-10-04 18:02:55 +02:00
parent 0ca2e791f7
commit 5541ee1c68

View file

@ -86,6 +86,7 @@ purpose.")
((help-p ["-h" "--help"] "Same as help command")
(auto-accept-p ["-y" "--yes"] "Auto-accept all confirmation prompts")
(debug-p ["-d" "--debug"] "Enables on verbose output")
(loadfile ["-l" "--load" file] "Load an elisp FILE before executing any commands")
(doomdir ["--doomdir" dir] "Use the private module at DIR (e.g. ~/.doom.d)")
(localdir ["--localdir" dir] "Use DIR as your local storage directory")
(nocolor ["-C" "--nocolor"] "Disable colored output")
@ -125,9 +126,8 @@ Environment variables:
(setenv "YES" auto-accept-p)
(print! (info "Confirmations auto-accept enabled")))
(throw 'exit "__DOOMRESTART=1 $@"))
;; TODO Rotate logs out, instead of overwriting them?
(delete-file doom-cli-log-file)
(delete-file doom-cli-log-error-file)
(when loadfile
(load (doom-path loadfile) nil t t))
(when help-p
(when command
(push command args))