From 3b9c00208868a75e6b77445fcd33d82536448bb2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 24 Jan 2013 22:00:54 +0100 Subject: guix-package: Error out when passed a non-option argument. * guix-package.in (guix-package)[parse-options]: Call `leave' when passed a non-option argument. Reported by Andreas Enge . * tests/guix-package.sh: Add test. --- guix-package.in | 2 +- tests/guix-package.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/guix-package.in b/guix-package.in index 85ac358555..37a1df0c11 100644 --- a/guix-package.in +++ b/guix-package.in @@ -326,7 +326,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) - (alist-cons 'argument arg result)) + (leave (_ "~A: extraneous argument~%") arg)) %default-options)) (define (guile-missing?) diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 603ae98d74..02ece68045 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -139,3 +139,6 @@ fi # Failed attempt to roll back. if guix-package --bootstrap --roll-back; then false; else true; fi + +# Extraneous argument. +! guix-package install foo-bar -- cgit v1.2.3