From 23b289b9a5cc85b3cf32ac96f37570a77c17162f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 22 Jun 2022 14:38:37 +0200 Subject: [PATCH] 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. --- core/core-cli-lib.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/core-cli-lib.el b/core/core-cli-lib.el index 227ee8090..e20fc5208 100644 --- a/core/core-cli-lib.el +++ b/core/core-cli-lib.el @@ -1413,6 +1413,8 @@ properties: version specifier, indicating when the command was deprecated. :disable BOOL If non-nil, the command will not be defined. + :docs STRING + An alternative to DOCSTRING for defining documentation for this command. :group (STR...) A breadcrumb of group names to file this command under. They will be organized by category in the CLI documentation (available through SCRIPT @@ -1494,7 +1496,7 @@ ignored. (doom-cli-create :command target :type type - :docs ',(doom-cli--parse-docs docstring) + :docs (doom-cli--parse-docs (or ',docstring docs)) :arguments ',arguments :options ',(nreverse options) :autoload autoload