aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-28 14:00:58 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-28 14:00:58 +0100
commit8fbf530260ec4b269e224de272727a3b4987296b (patch)
treea27cb17808e24974b5423bf0402bf01d22bbe286 /guix
parent30347040de9b1ffe9c8c9c26ebf0ed4254fb6fd6 (diff)
downloadgnu-guix-8fbf530260ec4b269e224de272727a3b4987296b.tar
gnu-guix-8fbf530260ec4b269e224de272727a3b4987296b.tar.gz
lint: Fix argument parsing when several packages are specified.
* guix/scripts/lint.scm (%options) <--checkers>: Remove 'arg-handler' parameter, and return a single value. (guix-lint)[parse-options]: Remove 'arg-handler' parameter from handlers. Remove second seed to 'args-fold*'. * tests/guix-lint.sh: Add test.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/lint.scm21
1 files changed, 10 insertions, 11 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 229b73702e..9d5c689618 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -482,7 +482,7 @@ Run a set of checkers on the specified package; if none is specified, run the ch
;; * --certainty=[low,medium,high]: only run checkers that have at least this
;; 'certainty'.
(list (option '(#\c "checkers") #t #f
- (lambda (opt name arg result arg-handler)
+ (lambda (opt name arg result)
(let ((names (map string->symbol (string-split arg #\,))))
(for-each (lambda (c)
(unless (memq c
@@ -490,13 +490,12 @@ Run a set of checkers on the specified package; if none is specified, run the ch
%checkers))
(leave (_ "~a: invalid checker~%") c)))
names)
- (values (alist-cons 'checkers
- (filter (lambda (checker)
- (member (lint-checker-name checker)
- names))
- %checkers)
- result)
- #f))))
+ (alist-cons 'checkers
+ (filter (lambda (checker)
+ (member (lint-checker-name checker)
+ names))
+ %checkers)
+ result))))
(option '(#\h "help") #f #f
(lambda args
(show-help)
@@ -517,11 +516,11 @@ Run a set of checkers on the specified package; if none is specified, run the ch
(define (parse-options)
;; Return the alist of option values.
(args-fold* args %options
- (lambda (opt name arg result arg-handler)
+ (lambda (opt name arg result)
(leave (_ "~A: unrecognized option~%") name))
- (lambda (arg result arg-handler)
+ (lambda (arg result)
(alist-cons 'argument arg result))
- %default-options #f))
+ %default-options))
(let* ((opts (parse-options))
(args (filter-map (match-lambda