summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-07-31 22:22:27 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-31 22:22:27 +0200
commit6ddf97f81bb99a73f00e30ad5fc19577872b5b49 (patch)
tree53b42106cf794edb6349b2b73818f371787617bf
parenta6b5af0cffd1655afc4cc32fd53c4d6f81e5c5f0 (diff)
downloadguix-6ddf97f81bb99a73f00e30ad5fc19577872b5b49.tar.gz
guix package: Warn when invoked with '-u -something'.
Fixes <https://bugs.gnu.org/27820>.
Reported by Hartmut Goebel <h.goebel@crazy-compilers.com>.

* guix/scripts/package.scm (%options) <"-u">: Emit a warning when ARG
starts with "-".
-rw-r--r--guix/scripts/package.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 8da7a3fd3a..b6133b6af0 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -486,6 +486,11 @@ Install, remove, or upgrade packages in a single transaction.\n"))
                              arg-handler))))
          (option '(#\u "upgrade") #f #t
                  (lambda (opt name arg result arg-handler)
+                   (when (string-prefix? "-" arg)
+                     (warning (G_ "upgrade regexp '~a' looks like a \
+command-line option~%")
+                              arg)
+                     (warning (G_ "is this intended?~%")))
                    (let arg-handler ((arg arg) (result result))
                      (values (alist-cons 'upgrade arg
                                          ;; Delete any prior "upgrade all"