tweak(cli): improve message when no similar commands found
Rather than display a blank line, let the user know no similar commands were found.
This commit is contained in:
parent
6eefd4c1df
commit
49ef0fa8dd
1 changed files with 7 additions and 5 deletions
|
@ -86,12 +86,14 @@ OPTIONS:
|
||||||
("--similar"
|
("--similar"
|
||||||
(unless command
|
(unless command
|
||||||
(user-error "No command specified"))
|
(user-error "No command specified"))
|
||||||
(when-let (similar (doom-cli-help-similar-commands command 0.4))
|
(let ((similar (doom-cli-help-similar-commands command 0.4)))
|
||||||
(print! "Similar commands:")
|
(print! "Similar commands:")
|
||||||
(dolist (command (seq-take similar 10))
|
(if (not similar)
|
||||||
(print! (indent (item "(%d%%) %s"))
|
(print! (indent (warn "Can't find any!")))
|
||||||
(* (car command) 100)
|
(dolist (command (seq-take similar 10))
|
||||||
(doom-cli-command-string (cdr command))))))
|
(print! (indent (item "(%d%%) %s"))
|
||||||
|
(* (car command) 100)
|
||||||
|
(doom-cli-command-string (cdr command)))))))
|
||||||
("--envvars"
|
("--envvars"
|
||||||
(let* ((key "ENVIRONMENT VARIABLES")
|
(let* ((key "ENVIRONMENT VARIABLES")
|
||||||
(clis (if command (doom-cli-find command) (hash-table-values doom-cli--table)))
|
(clis (if command (doom-cli-find command) (hash-table-values doom-cli--table)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue