From e651547abb27e762b390fb2794c6e81458ea28bd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 22 Jun 2022 19:28:58 +0200 Subject: [PATCH] fix(cli): &rest not consuming rest of arguments An edge case that occurs when no options are supplied to make arguments non-null. --- core/core-cli-lib.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core-cli-lib.el b/core/core-cli-lib.el index eda5acbad..e4ca7aaf3 100644 --- a/core/core-cli-lib.el +++ b/core/core-cli-lib.el @@ -764,6 +764,7 @@ executable context." ((when-let* (((null arguments)) + ((not rest?)) (command (append (doom-cli--command context) (list arg))) (cli (doom-cli-get command t)) (rcli (doom-cli-get command)) @@ -784,7 +785,7 @@ executable context." (setf (map-elt (doom-cli-context-options context) switch) nil))))) (when (and (doom-cli-fn rcli) - (alist-get '&rest (doom-cli-arguments cli))) + (alist-get '&rest (doom-cli-arguments rcli))) (setq rest? t)) t))