diff mbox series

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

Message ID 20210210214804.44637-1-zimon.toutoune@gmail.com
State New
Headers show
Series guix time-machine: fail when unrecognized option | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

zimoun Feb. 10, 2021, 9:48 p.m. UTC
* guix/scripts/time-machine (parse-args): Fail when unrecognized option.
---
 guix/scripts/time-machine.scm | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

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 <konrad.hinsen@fastmail.net>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; 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)