From f1c4df15c31a81cca03a748a21ec38774e8114c0 Mon Sep 17 00:00:00 2001 From: zimoun Date: Wed, 10 Feb 2021 22:48:04 +0100 Subject: time-machine: Fail when unrecognized option. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/time-machine (parse-args): Fail when unrecognized option. Co-authored-by: Ludovic Courtès --- guix/scripts/time-machine.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'guix/scripts') diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm index 0d27414702..4aafd432e8 100644 --- a/guix/scripts/time-machine.scm +++ b/guix/scripts/time-machine.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Konrad Hinsen ;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2021 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -118,6 +119,10 @@ (define (parse-args args) (let-values (((args command) (break (cut string=? "--" <>) args))) (let ((opts (parse-command-line args %options (list %default-options)))) + (when (assoc-ref opts 'argument) + (leave (G_ "~A: extraneous argument~%") + (assoc-ref opts 'argument))) + (match command (() opts) (("--") opts) -- cgit v1.2.3