(('argument . arg) arg)
(_ #f))
opts)))
+ (define (assert-no-extra-arguments)
+ (unless (null? paths)
+ (leave (_ "extraneous arguments: ~{~a ~}~%") paths)))
+
(define (list-relatives relatives)
(for-each (compose (lambda (path)
(for-each (cut simple-format #t "~a~%" <>)
(case (assoc-ref opts 'action)
((collect-garbage)
+ (assert-no-extra-arguments)
(let ((min-freed (assoc-ref opts 'min-freed)))
(if min-freed
(collect-garbage store min-freed)
((list-referrers)
(list-relatives referrers))
((optimize)
+ (assert-no-extra-arguments)
(optimize-store store))
((verify)
+ (assert-no-extra-arguments)
(let ((options (assoc-ref opts 'verify-options)))
(exit
(verify-store store
# GNU Guix --- Functional package management for GNU
-# Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
trap "rm -f guix-gc-root" EXIT
rm -f guix-gc-root
+# For some operations, passing extra arguments is an error.
+for option in "" "-C 500M" "--verify" "--optimize"
+do
+ if guix gc $option whatever; then false; else true; fi
+done
+
# Check the references of a .drv.
drv="`guix build guile-bootstrap -d`"
out="`guix build guile-bootstrap`"