Subject: [bug#46429] [PATCH 1/1] scripts: time-machine: Fail when unrecognized option.

From: zimoun <[email-masked]>
Date: Wed, 10 Feb 2021 22:48:04 +0100

* guix/scripts/time-machine (parse-args): Fail when unrecognized option.
---
 guix/scripts/time-machine.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index 0d27414702..c6ab30e132 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 <[email-masked]>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2021 Simon Tournier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -118,6 +119,8 @@ Execute COMMAND ARGS... in an older version of Guix.\n"))
   (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_ "unrecognized option~%")))
       (match command
         (() opts)
         (("--") opts)
-- 
2.29.2