refactor(cli): remove :stub, :obsolete, :deprecated, :since

I've removed these CLI properties because they were either
unused (:deprecated and :since) or poorly implemented (:stub and
:obsolete). And I'd rather have fewer magical properties, and instead
delegate these roles to the defobsolete! and (new) defstub!  macros.
Also, in the future, the help API will ascertain :since dynamically, so
it won't be very useful.

In summary:
- Use defstub! instead of :stub
- Use defobsolete! instead of :obsolete or :deprecated
- This removes the doom-cli-deprecated-error type (it's not really an
  error to begin with).
- Removes :stub, :obsolete, :deprecated, and :since
This commit is contained in:
Henrik Lissner 2022-06-22 18:46:23 +02:00
parent a4aab45656
commit 666cc1fda7
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
7 changed files with 32 additions and 45 deletions

View file

@ -319,7 +319,7 @@ Note: warnings are not considered failures.")
commits))))
;;; TODO
(defcli! (ci run-tests) (&rest targets) :stub t)
(defstub! (ci run-tests))
;;; doom ci hook
(defcli! (ci hook commit-msg) (file)

View file

@ -22,9 +22,8 @@
:partial t)
;; TODO Finish and generalize me
(defcli! (make codeowners) ()
(defstub! (make codeowners) ()
"TODO"
:stub t
(print! (start "Generating CODEOWNERS file"))
(let ((codeowners (doom-path doom-emacs-dir ".github/CODEOWNERS")))
(with-temp-file codeowners
@ -41,7 +40,7 @@
(match-string-no-properties 2 path)))))))))
;; TODO Finish me
(defcli! (make changelog) () :stub t)
(defstub! (make changelog))

View file

@ -18,7 +18,6 @@
;; TODO (outfile ("-o" "--outfile" file))
&context context &args args)
"Generate completion scripts for a Doom-CLI script."
;; :stub t
;; (unless outfile
;; (user-error "No destination file specified"))
(let ((shell (or shell (file-name-base (getenv "SHELL"))))

View file

@ -58,7 +58,7 @@ list remains lean."
(doom-autoloads-reload))
t)
(defcli! rollback () :stub t) ; TODO Implement me post-3.0
(defstub! rollback) ; TODO Implement me post-3.0
;;

View file

@ -67,7 +67,7 @@ OPTIONS:
(remove-hook 'kill-emacs-hook #'doom-sync--abort-warning-h)))
;; DEPRECATED Remove when v3.0 is released
(defobsolete! ((refresh re)) "doom sync" "v3.0.0")
(defobsolete! ((refresh re)) (sync) "v3.0.0")
;;