* [bug#46429] [PATCH 0/1] guix time-machine: fail when unrecognized option
@ 2021-02-10 21:38 zimoun
2021-02-10 21:48 ` [bug#46429] [PATCH 1/1] scripts: time-machine: Fail " zimoun
0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2021-02-10 21:38 UTC (permalink / raw)
To: 46429; +Cc: zimoun
Hi,
Currently, the command line:
--8<---------------cut here---------------start------------->8---
$ guix time-machine kikoo -- --version
guix (GNU Guix) 8f8a1485b80de707caecf6e7e29b520cd8cf611e
Copyright © 2021 les auteurs de Guix
Licence GPLv3+ : GNU GPL version 3 ou ultérieure <http://www.gnu.org/licenses/gpl.fr.html>
Ceci est un logiciel libre : vous êtes libre de le modifier et de le redistribuer.
Il n'y a AUCUNE GARANTIE, dans les limites permises par la loi.
--8<---------------cut here---------------end--------------->8---
does not fail but uses the current commit. This leads to confusing behaviour
as described in <http://issues.guix.gnu.org/46336>, for instance:
$ guix time-machine 8e7e414aa998fe8c0de8a491c91aab8b8d9c58f4 -- graph maven
which had failed with:
--8<---------------cut here---------------start------------->8---
"453f18db343cbad1892186b85c7eb07f364b399e"; system: "x86_64-linux";
host version: "838347207cdd96de1ad0127aaf4b2c378c7c2148"; pull-version: 1).
--8<---------------cut here---------------end--------------->8---
The failure is another reason. However the backtrace is not informative about
the real issue which is a misuse of the command line.
This trivial patch fixes it by gracefully failing.
All the best,
simon
zimoun (1):
scripts: time-machine: Fail when unrecognized option.
guix/scripts/time-machine.scm | 3 +++
1 file changed, 3 insertions(+)
base-commit: 8f8a1485b80de707caecf6e7e29b520cd8cf611e
--
2.29.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [bug#46429] [PATCH 1/1] scripts: time-machine: Fail when unrecognized option.
2021-02-10 21:38 [bug#46429] [PATCH 0/1] guix time-machine: fail when unrecognized option zimoun
@ 2021-02-10 21:48 ` zimoun
2021-03-11 22:25 ` bug#46429: [PATCH 0/1] guix time-machine: fail " Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2021-02-10 21:48 UTC (permalink / raw)
To: 46429; +Cc: zimoun
* 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 <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)
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#46429: [PATCH 0/1] guix time-machine: fail when unrecognized option
2021-02-10 21:48 ` [bug#46429] [PATCH 1/1] scripts: time-machine: Fail " zimoun
@ 2021-03-11 22:25 ` Ludovic Courtès
0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2021-03-11 22:25 UTC (permalink / raw)
To: zimoun; +Cc: 46429-done
Hi!
zimoun <zimon.toutoune@gmail.com> skribis:
> * guix/scripts/time-machine (parse-args): Fail when unrecognized option.
I tweaked the error message to be consistent with the other commands and
pushed as f1c4df15c31a81cca03a748a21ec38774e8114c0.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-11 22:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 21:38 [bug#46429] [PATCH 0/1] guix time-machine: fail when unrecognized option zimoun
2021-02-10 21:48 ` [bug#46429] [PATCH 1/1] scripts: time-machine: Fail " zimoun
2021-03-11 22:25 ` bug#46429: [PATCH 0/1] guix time-machine: fail " Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.