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 <andreas@enge.fr>. * tests/guix-package.sh: Add test.
This commit is contained in:
parent
313b901255
commit
3b9c002088
@ -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?)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user