Skip to content
Snippets Groups Projects
Commit 3b9c0020 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

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.
parent 313b9012
No related branches found
No related tags found
No related merge requests found
...@@ -326,7 +326,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) ...@@ -326,7 +326,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
(lambda (opt name arg result) (lambda (opt name arg result)
(leave (_ "~A: unrecognized option~%") name)) (leave (_ "~A: unrecognized option~%") name))
(lambda (arg result) (lambda (arg result)
(alist-cons 'argument arg result)) (leave (_ "~A: extraneous argument~%") arg))
%default-options)) %default-options))
(define (guile-missing?) (define (guile-missing?)
......
...@@ -139,3 +139,6 @@ fi ...@@ -139,3 +139,6 @@ fi
# Failed attempt to roll back. # Failed attempt to roll back.
if guix-package --bootstrap --roll-back; if guix-package --bootstrap --roll-back;
then false; else true; fi then false; else true; fi
# Extraneous argument.
! guix-package install foo-bar
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment