feat(cli): fall back to :docs for docstring

Also allows for a dynamically generated docstring. Careful though, it's
evaluated when `defcli!` is evaluated, not when the CLI is executed.
This commit is contained in:
Henrik Lissner 2022-06-22 14:38:37 +02:00
parent 209092c578
commit 23b289b9a5
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -1413,6 +1413,8 @@ properties:
version specifier, indicating when the command was deprecated. version specifier, indicating when the command was deprecated.
:disable BOOL :disable BOOL
If non-nil, the command will not be defined. If non-nil, the command will not be defined.
:docs STRING
An alternative to DOCSTRING for defining documentation for this command.
:group (STR...) :group (STR...)
A breadcrumb of group names to file this command under. They will be A breadcrumb of group names to file this command under. They will be
organized by category in the CLI documentation (available through SCRIPT organized by category in the CLI documentation (available through SCRIPT
@ -1494,7 +1496,7 @@ ignored.
(doom-cli-create (doom-cli-create
:command target :command target
:type type :type type
:docs ',(doom-cli--parse-docs docstring) :docs (doom-cli--parse-docs (or ',docstring docs))
:arguments ',arguments :arguments ',arguments
:options ',(nreverse options) :options ',(nreverse options)
:autoload autoload :autoload autoload