From db761534df3b57122da8e8b05a678182b59a9d3a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 24 May 2016 21:37:13 +0200 Subject: size: Accept several arguments. * guix/scripts/size.scm (display-profile): Display WHOLE at then end. (guix-size): Accept several FILES. * doc/guix.texi (Invoking guix size): Add example with several items. --- guix/scripts/size.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'guix/scripts/size.scm') diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index 8a7974729b..843213834e 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -91,7 +91,8 @@ (define MiB (expt 2 20)) (sort profile (match-lambda* ((($ _ _ total1) ($ _ _ total2)) - (> total1 total2))))))) + (> total1 total2))))) + (format port (_ "total: ~,1f MiB~%") (/ whole MiB 1.)))) (define display-profile* (lift display-profile %store-monad)) @@ -280,7 +281,7 @@ (define (guix-size . args) (match files (() (leave (_ "missing store item argument\n"))) - ((file) + ((files ..1) (leave-on-EPIPE ;; Turn off grafts because (1) hydra.gnu.org does not serve grafted ;; packages, and (2) they do not make any difference on the @@ -292,13 +293,12 @@ (define (guix-size . args) #:substitute-urls urls) (run-with-store store - (mlet* %store-monad ((item (ensure-store-item file)) - (profile (store-profile (list item)))) + (mlet* %store-monad ((items (mapm %store-monad + ensure-store-item files)) + (profile (store-profile items))) (if map-file (begin (profile->page-map profile map-file) (return #t)) (display-profile* profile))) - #:system system))))) - ((files ...) - (leave (_ "too many arguments\n"))))))) + #:system system))))))))) -- cgit v1.2.3