[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/04: time-machine: Fail when unrecognized option.
From: |
guix-commits |
Subject: |
03/04: time-machine: Fail when unrecognized option. |
Date: |
Thu, 11 Mar 2021 17:24:58 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit f1c4df15c31a81cca03a748a21ec38774e8114c0
Author: zimoun <zimon.toutoune@gmail.com>
AuthorDate: Wed Feb 10 22:48:04 2021 +0100
time-machine: Fail when unrecognized option.
* guix/scripts/time-machine (parse-args): Fail when unrecognized option.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
---
guix/scripts/time-machine.scm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index 0d27414..4aafd43 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,10 @@ 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_ "~A: extraneous argument~%")
+ (assoc-ref opts 'argument)))
+
(match command
(() opts)
(("--") opts)