def-command! -> defcli!

And def-command-group! -> defcligroup!, to match our new convention for
naming definer macros.
This commit is contained in:
Henrik Lissner 2019-07-28 01:32:16 +02:00
parent 0a05fd09c3
commit 4dc42de9e3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
10 changed files with 25 additions and 25 deletions

View file

@ -17,7 +17,7 @@ one wants that.")
;;
;;; Commands
(def-command! (autoloads a) ()
(defcli! (autoloads a) ()
"Regenerates Doom's autoloads files.
It scans and reads autoload cookies (;;;###autoload) in core/autoload/*.el,

View file

@ -1,6 +1,6 @@
;;; core/cli/byte-compile.el -*- lexical-binding: t; -*-
(def-command! (compile c) (&rest targets)
(defcli! (compile c) (&rest targets)
"Byte-compiles your config or selected modules.
compile [TARGETS...]
@ -12,11 +12,11 @@ and your private config files, respectively. To recompile your packages, use
'doom rebuild' instead."
(doom-byte-compile targets))
(def-command! (recompile rc) (&rest targets)
(defcli! (recompile rc) (&rest targets)
"Re-byte-compiles outdated *.elc files."
(doom-byte-compile targets 'recompile))
(def-command! clean ()
(defcli! clean ()
"Delete all *.elc files."
(doom-clean-byte-compiled-files))

View file

@ -6,7 +6,7 @@
;;
;;; Commands
(def-command! info (&optional format)
(defcli! info (&optional format)
"Output system info in markdown for bug reports.
Will print in the following formats:
@ -32,7 +32,7 @@ If no arguments are given, --raw is assumed."
format)))
nil)
(def-command! (version v) ()
(defcli! (version v) ()
"Reports the version of Doom and Emacs."
(doom/version)
nil)

View file

@ -1,6 +1,6 @@
;;; core/cli/env.el -*- lexical-binding: t; -*-
(def-command! env (&rest args)
(defcli! env (&rest args)
"Regenerates your envvars file.
doom env [-c|--clear]

View file

@ -1,13 +1,13 @@
;;; core/cli/install.el -*- lexical-binding: t; -*-
(def-command! quickstart (&rest args) ; DEPRECATED
(defcli! quickstart (&rest args) ; DEPRECATED
"This is a deprecated alias for 'doom install'.
See 'doom help install' instead."
:hidden t
(apply #'doom-cli-install args))
(def-command! (install i) (&rest args)
(defcli! (install i) (&rest args)
"A wizard for installing Doom for the first time.
This command does the following:

View file

@ -12,7 +12,7 @@
;;
;;; Dispatchers
(def-command! (update u) ()
(defcli! (update u) ()
"Updates packages.
This excludes packages whose `package!' declaration contains a non-nil :freeze
@ -21,7 +21,7 @@ or :ignore property."
(straight-check-all)
(doom-packages-update doom-auto-accept)))
(def-command! (rebuild b) (&rest args)
(defcli! (rebuild b) (&rest args)
"Rebuilds all installed packages.
This ensures that all needed files are symlinked from their package repo and
@ -29,7 +29,7 @@ their elisp files are byte-compiled."
(doom--ensure-autoloads-while
(doom-packages-rebuild doom-auto-accept (member "-f" args))))
(def-command! (purge p) (&rest args)
(defcli! (purge p) (&rest args)
"Deletes any unused packages and repos."
(doom--ensure-autoloads-while
(straight-check-all)
@ -37,7 +37,7 @@ their elisp files are byte-compiled."
(member "-f" args)
doom-auto-accept)))
;; (def-command! rollback () ; TODO rollback
;; (defcli! rollback () ; TODO rollback
;; "<Not implemented yet>"
;; (user-error "Not implemented yet, sorry!"))

View file

@ -1,6 +1,6 @@
;;; core/cli/patch-macos.el -*- lexical-binding: t; -*-
(def-command! patch-macos () ; DEPRECATED
(defcli! patch-macos () ; DEPRECATED
"Patches Emacs.app to respect your shell environment.
WARNING: This command is deprecated. Use 'doom env' instead.

View file

@ -1,6 +1,6 @@
;;; core/cli/test.el -*- lexical-binding: t; -*-
(def-command! test ()
(defcli! test ()
"Run Doom unit tests.")

View file

@ -1,6 +1,6 @@
;;; core/cli/upgrade.el -*- lexical-binding: t; -*-
(def-command! (upgrade up) ()
(defcli! (upgrade up) ()
"Updates Doom and packages.
This requires that ~/.emacs.d is a git repo, and is the equivalent of the

View file

@ -114,14 +114,14 @@ If SHOW-HELP is non-nil, show the documentation for said dispatcher."
(user-error "I don't understand 'doom %s %s'\n\nRun 'doom help' to see what I do understand." cmd (string-join args " "))))
(run-hooks 'doom-cli-post-error-execute-hook))))))
(defmacro def-command-group! (name docstring &rest body)
(defmacro defcligroup! (name docstring &rest body)
"TODO"
(declare (indent defun) (doc-string 2))
`(let ((doom--cli-group ,name))
(puthash doom--cli-group ,docstring doom--cli-groups)
,@body))
(defmacro def-command! (names arglist docstring &rest body)
(defmacro defcli! (names arglist docstring &rest body)
"Define a dispatcher command. COMMAND is a symbol or a list of symbols
representing the aliases for this command. DESC is a string description. The
first line should be short (under 60 letters), as it will be displayed for
@ -151,7 +151,7 @@ BODY will be run when this dispatcher is called."
;;; Dispatch commands
;; Load all of our subcommands
(def-command! (refresh re) (&rest args)
(defcli! (refresh re) (&rest args)
"Ensure Doom is properly set up.
This is the equivalent of running autoremove, install, autoloads, then
@ -188,9 +188,9 @@ stale."
;; Load all of our subcommands
(load! "cli/install")
(def-command-group! "Diagnostics"
(defcligroup! "Diagnostics"
"For troubleshooting and diagnostics"
(def-command! (doctor doc) ()
(defcli! (doctor doc) ()
"Checks for issues with your environment & Doom config.
Use the doctor to diagnose common problems or list missing dependencies in
@ -199,7 +199,7 @@ enabled modules.")
(load! "cli/debug")
(load! "cli/test"))
(def-command-group! "Maintenance"
(defcligroup! "Maintenance"
"For managing your config and packages"
(load! "cli/env")
(load! "cli/upgrade")
@ -207,13 +207,13 @@ enabled modules.")
(load! "cli/autoloads")
(load! "cli/patch-macos"))
(def-command-group! "Byte compilation"
(defcligroup! "Byte compilation"
"For byte-compiling Doom and your config"
(load! "cli/byte-compile"))
(def-command-group! "Utilities"
(defcligroup! "Utilities"
"Conveniences for interacting with Doom externally"
(def-command! run ()
(defcli! run ()
"Run Doom Emacs from bin/doom's parent directory.
All arguments are passed on to Emacs (except for -p and -e).