Browse Source

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.
gn-latest-20200428
Ludovic Courtès 9 years ago
parent
commit
3b9c002088
2 changed files with 4 additions and 1 deletions
  1. +1
    -1
      guix-package.in
  2. +3
    -0
      tests/guix-package.sh

+ 1
- 1
guix-package.in View File

@ -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?)


+ 3
- 0
tests/guix-package.sh View File

@ -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…
Cancel
Save