diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2021-10-31 12:47:14 +0200 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2021-10-31 14:49:47 +0200 |
commit | bc5155b952ae8bdbc56aded4d8d39768b4e2a7d4 (patch) | |
tree | 6b55475d86c522543384dea7d1ab66bba32af63e /guix/ui.scm | |
parent | dac8d013bd1fc7f57b8ba3582eef6e0e01b23dfd (diff) | |
parent | 4e5000114ec01b5e92a87c52f2a10f9ba7a601c8 (diff) |
Merge remote-tracking branch 'origin/master' into core-updates-frozen
Diffstat (limited to 'guix/ui.scm')
-rw-r--r-- | guix/ui.scm | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index 1428c254b3..b01bb3d587 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1431,10 +1431,22 @@ converted to a space; sequences of more than one line break are preserved." (with-fluids ((%default-port-encoding "UTF-8")) (stexi->plain-text (texi-fragment->stexi str)))) +(define (texi->plain-text* package str) + "Same as 'texi->plain-text', but gracefully handle Texinfo errors." + (catch 'parser-error + (lambda () + (texi->plain-text str)) + (lambda args + (warning (package-location package) + (G_ "~a: invalid Texinfo markup~%") + (package-full-name package)) + str))) + (define (package-field-string package field-accessor) "Return a plain-text representation of PACKAGE field." (and=> (field-accessor package) - (compose texi->plain-text P_))) + (lambda (str) + (texi->plain-text* package (P_ str))))) (define (package-description-string package) "Return a plain-text representation of PACKAGE description field." @@ -1555,7 +1567,8 @@ HYPERLINKS? is true, emit hyperlink escape sequences when appropriate." (parameterize ((%text-width width*)) ;; Call 'texi->plain-text' on the concatenated string to account ;; for the width of "description:" in paragraph filling. - (texi->plain-text + (texi->plain-text* + p (string-append "description: " (or (and=> (package-description p) P_) "")))) @@ -2085,10 +2098,17 @@ contain a 'define-command' form." (lambda (command) (eq? category (command-category command)))) - (format #t (G_ "Usage: guix COMMAND ARGS... -Run COMMAND with ARGS.\n")) + (display (G_ "Usage: guix OPTION | COMMAND ARGS... +Run COMMAND with ARGS, if given.\n")) + + (display (G_ " + -h, --help display this helpful text again and exit")) + (display (G_ " + -V, --version display version and copyright information and exit")) + (newline) + (newline) - (format #t (G_ "COMMAND must be one of the sub-commands listed below:\n")) + (display (G_ "COMMAND must be one of the sub-commands listed below:\n")) (let ((commands (commands)) (categories (module-ref (resolve-interface '(guix scripts)) |