[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/16: pull: '--list-generations' pipes its output to the pager.
From: |
guix-commits |
Subject: |
09/16: pull: '--list-generations' pipes its output to the pager. |
Date: |
Mon, 14 Feb 2022 09:53:40 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 054ec2e242b2e5d89711c333f4048fc1d749eab6
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Feb 9 22:21:06 2022 +0100
pull: '--list-generations' pipes its output to the pager.
* guix/scripts/pull.scm (process-query): For 'list-generations queries,
use 'with-paginated-output-port'.
(display-news-entry-title): Pass second argument to 'highlight'.
(display-news-entry): Pass second argument to 'dim'.
---
guix/scripts/pull.scm | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index a3bb6db8c6..205697b3bd 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -287,7 +287,8 @@ purposes."
(texi->plain-text title))
;; When Texinfo markup is invalid, display it as-is.
- (const title)))))))
+ (const title)))
+ (or (pager-wrapped-port port) port)))))
(define (display-news-entry entry channel language port)
"Display ENTRY, a <channel-news-entry> from CHANNEL, in LANGUAGE, a language
@@ -299,7 +300,8 @@ code, to PORT."
(channel-news-entry-commit entry))
(display-news-entry-title entry language port)
- (format port (dim (G_ " commit ~a~%"))
+ (format port (dim (G_ " commit ~a~%")
+ (or (pager-wrapped-port port) port))
(if (supports-hyperlinks?)
(channel-commit-hyperlink channel commit)
commit))
@@ -681,14 +683,20 @@ Return true when there is more package info to display."
(raise (condition (&profile-not-found-error
(profile profile)))))
((not pattern)
- (list-generations profile (profile-generations profile)))
+ (with-paginated-output-port port
+ (with-output-to-port port
+ (lambda ()
+ (list-generations profile (profile-generations profile))))))
((matching-generations pattern profile)
=>
(match-lambda
(()
(exit 1))
((numbers ...)
- (list-generations profile numbers)))))))
+ (with-paginated-output-port port
+ (with-output-to-port port
+ (lambda ()
+ (list-generations profile numbers))))))))))
(('display-news)
(display-news profile))))
- 05/16: gnu: Remove glibc@2.2.5 and gcc-2.95-wrapper., (continued)
- 05/16: gnu: Remove glibc@2.2.5 and gcc-2.95-wrapper., guix-commits, 2022/02/14
- 04/16: gnu: ghc@4: Build without referring to packages in commencement.scm., guix-commits, 2022/02/14
- 06/16: pull: '--list-generations' lists packages only with '--details'., guix-commits, 2022/02/14
- 08/16: ui: 'display-generation' uses color when talking to a pager., guix-commits, 2022/02/14
- 12/16: gnu: fcitx5-gtk: Add GTK 4 support., guix-commits, 2022/02/14
- 07/16: ui: 'with-paginated-output-port' gives access to the wrapped port., guix-commits, 2022/02/14
- 14/16: gnu: Add libnitrokey., guix-commits, 2022/02/14
- 15/16: gnu: Add cppcodec., guix-commits, 2022/02/14
- 01/16: gnu: nhc98: Build with the current tool chain., guix-commits, 2022/02/14
- 16/16: gnu: Add nitrokey-app., guix-commits, 2022/02/14
- 09/16: pull: '--list-generations' pipes its output to the pager.,
guix-commits <=
- 11/16: gnu: elixir: Fix regex for ERTS_BIN substitution., guix-commits, 2022/02/14
- 10/16: gnu: elixir: Fix file name argument to 'search-input-file'., guix-commits, 2022/02/14
- 13/16: gnu: fcitx5-gtk: Split IM module output for different version of GTK., guix-commits, 2022/02/14