diff mbox series

[bug#62222] ui: format 'display-hint' output when no arguments are passed.

Message ID 20230316161120.9294-1-antero@mailbox.org
State New
Headers show
Series [bug#62222] ui: format 'display-hint' output when no arguments are passed. | expand

Commit Message

Antero Mejr March 16, 2023, 4:11 p.m. UTC
When display-hint is given format specifiers such as "~%" but no arguments,
it does not format the output, causing the specifiers to be visible in the
displayed text.

* guix/ui.scm (display-hint): Format output when no arguments are passed.
---
Steps to reproduce the issue this fixes:
$ guix build -s whatever hello

guix build: error: 'whatever' is not a supported system
hint: Try `--list-systems' to view available system types.~%

 guix/ui.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ludovic Courtès March 17, 2023, 9:08 p.m. UTC | #1
Hi,

Antero Mejr <antero@mailbox.org> skribis:

> When display-hint is given format specifiers such as "~%" but no arguments,
> it does not format the output, causing the specifiers to be visible in the
> displayed text.
>
> * guix/ui.scm (display-hint): Format output when no arguments are passed.

Oops, good catch!  Applied, thanks.

Ludo’.
diff mbox series

Patch

diff --git a/guix/ui.scm b/guix/ui.scm
index b6c3bd04ba..7540e2194f 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -323,7 +323,7 @@  (define colorize
    ;; XXX: We should arrange so that the initial indent is wider.
    (parameterize ((%text-width (max 15 (- (terminal-columns) 5))))
      (texi->plain-text (match arguments
-                         (() message)
+                         (() (format #f message))
                          (_  (apply format #f message
                                     (map (match-lambda
                                            ((? string? str)