From a1ff7e1d8dfb86ae1817d4e0db4ddeebd2083e83 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2017 13:28:00 -0700 Subject: scripts: Factorize option parsing sans 'GUIX_BUILD_OPTIONS'. * guix/scripts.scm (parse-command-line): Add #:build-options? parameter and honor it. * guix/scripts/challenge.scm (guix-challenge): Use 'parse-command-line' with #:build-options? #f instead of 'args-fold*'. * guix/scripts/gc.scm (guix-gc): Likewise. * guix/scripts/graph.scm (guix-graph): Likewise. * guix/scripts/hash.scm (guix-hash): Likewise. * guix/scripts/lint.scm (guix-lint): Likewise. * guix/scripts/refresh.scm (guix-refresh): Likewise. * guix/scripts/size.scm (guix-size): Likewise. * guix/scripts/weather.scm (guix-weather): Likewise. --- guix/scripts/size.scm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'guix/scripts/size.scm') diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index dee3604174..b7b53e43fb 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -291,12 +291,8 @@ Report the size of PACKAGE and its dependencies.\n")) (define (guix-size . args) (with-error-handling - (let* ((opts (args-fold* args %options - (lambda (opt name arg . rest) - (leave (G_ "~A: unrecognized option~%") name)) - (lambda (arg result) - (alist-cons 'argument arg result)) - %default-options)) + (let* ((opts (parse-command-line args %options (list %default-options) + #:build-options? #f)) (files (filter-map (match-lambda (('argument . file) file) (_ #f)) -- cgit v1.2.3