mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
guix package, show: Support multiple queries.
* guix/scripts/package.scm (process-query): Show multiple queries. * guix/scripts/show.scm (guix-show): Reverse to display in order. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
bdc801e1cf
commit
baf1ce82b1
2 changed files with 22 additions and 13 deletions
|
@ -8,6 +8,7 @@
|
|||
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
|
||||
;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -787,18 +788,26 @@ (define (diff-profiles profile numbers)
|
|||
(display-search-results matches (current-output-port)))
|
||||
#t))
|
||||
|
||||
(('show requested-name)
|
||||
(let-values (((name version)
|
||||
(package-name->name+version requested-name)))
|
||||
(match (remove package-superseded
|
||||
(find-packages-by-name name version))
|
||||
(()
|
||||
(leave (G_ "~a~@[@~a~]: package not found~%") name version))
|
||||
(packages
|
||||
(leave-on-EPIPE
|
||||
(for-each (cute package->recutils <> (current-output-port))
|
||||
packages))))
|
||||
#t))
|
||||
(('show _)
|
||||
(let ((requested-names
|
||||
(filter-map (match-lambda
|
||||
(('query 'show requested-name) requested-name)
|
||||
(_ #f))
|
||||
opts)))
|
||||
(for-each
|
||||
(lambda (requested-name)
|
||||
(let-values (((name version)
|
||||
(package-name->name+version requested-name)))
|
||||
(match (remove package-superseded
|
||||
(find-packages-by-name name version))
|
||||
(()
|
||||
(leave (G_ "~a~@[@~a~]: package not found~%") name version))
|
||||
(packages
|
||||
(leave-on-EPIPE
|
||||
(for-each (cute package->recutils <> (current-output-port))
|
||||
packages))))))
|
||||
requested-names))
|
||||
#t)
|
||||
|
||||
(('search-paths kind)
|
||||
(let* ((manifests (map profile-manifest profiles))
|
||||
|
|
|
@ -73,4 +73,4 @@ (define opts
|
|||
(unless (assoc-ref opts 'query)
|
||||
(leave (G_ "missing arguments: no package to show~%")))
|
||||
|
||||
(guix-package* opts))
|
||||
(guix-package* (reverse opts)))
|
||||
|
|
Loading…
Reference in a new issue