fix(cli): various errors in 'doom help'

- Wrong number of arguments: #<subr max> 0
- Symbol's value as variable is void: localonly?

Amend: 6c0b7e1530
This commit is contained in:
Henrik Lissner 2022-06-19 12:38:51 +02:00
parent 42d84e7e21
commit 8d881f44c4
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -216,7 +216,7 @@ OPTIONS:
.commands :prefix (doom-cli-command cli) :grouped? t :docs? t)) .commands :prefix (doom-cli-command cli) :grouped? t :docs? t))
("OPTIONS" ("OPTIONS"
. ,(doom-cli-help--render-options . ,(doom-cli-help--render-options
(if (or (not (doom-cli-fn cli)) localonly?) (if (or (not (doom-cli-fn cli)) noglobal?)
`(,(assq 'local .options)) `(,(assq 'local .options))
.options) .options)
cli))))) cli)))))
@ -305,9 +305,12 @@ OPTIONS:
(toplevel (assq nil commands)) (toplevel (assq nil commands))
(rest (nreverse (remove toplevel commands))) (rest (nreverse (remove toplevel commands)))
(drop (if prefix (length prefix) 0)) (drop (if prefix (length prefix) 0))
(minwidth (apply #'max (cl-loop for cmd in (apply #'append (mapcar #'cdr commands)) (minwidth
for cmd = (seq-drop cmd drop) (apply
collect (length (doom-cli-command-string cmd))))) #'max (or (cl-loop for cmd in (apply #'append (mapcar #'cdr commands))
for cmd = (seq-drop cmd drop)
collect (length (doom-cli-command-string cmd)))
(list 15))))
(ellipsis (doom-print--style 'dark " […]")) (ellipsis (doom-print--style 'dark " […]"))
(ellipsislen (- (length ellipsis) (if (eq doom-print-backend 'ansi) 2 4)))) (ellipsislen (- (length ellipsis) (if (eq doom-print-backend 'ansi) 2 4))))
(dolist (group (cons toplevel rest)) (dolist (group (cons toplevel rest))