Make bin/doom options consistent & improve errors/docs

This commit is contained in:
Henrik Lissner 2019-07-25 19:42:01 +02:00
parent 829ad8c8b7
commit 44c694da47
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 66 additions and 34 deletions

View file

@ -7,17 +7,29 @@
;;; Commands
(def-command! info (&optional format)
"Output system info in markdown for bug reports."
"Output system info in markdown for bug reports.
Will print in the following formats:
--json
--md / --markdown
--lisp
If no arguments are given, --raw is assumed."
(pcase format
("json"
("--json"
(require 'json)
(with-temp-buffer
(insert (json-encode (doom-info)))
(json-pretty-print-buffer)
(print! (buffer-string))))
((or "md" "markdown")
((or "--md" "--markdown")
(doom/info))
(_ (doom/info 'raw)))
((or `nil "--lisp")
(doom/info 'raw))
(_
(user-error "I don't understand %S. Did you mean --json, --md/--markdown or --lisp?"
format)))
nil)
(def-command! (version v) ()