summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-11-20 14:50:49 +0100
committerLudovic Courtès <ludo@gnu.org>2023-11-22 16:51:45 +0100
commitc39c89c11eb58b825ab4adbe53165b20b6f1e6f4 (patch)
treea03b15cd67d3a86d3a67db46e4b5b27e39bba143 /guix
parent857f5017507cfe6cbf742bfb7d33c1520f8c6d15 (diff)
style: ‘guix style -f’ warns when passed zero arguments.
* guix/scripts/style.scm (guix-style): When OPTS has ‘whole-file?’ set, warn when FILES is empty. Change-Id: I494f52ef5d070510d20006e6dd987a6805161bb4
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/style.scm2
1 files changed, 2 insertions, 0 deletions
diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 145cd09881..211980dc1c 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -625,6 +625,8 @@ Update package definitions to the latest style.\n"))
opts)))
(unless (eq? format-package-definition style)
(warning (G_ "'--styling' option has no effect in whole-file mode~%")))
+ (when (null? files)
+ (warning (G_ "no files specified, nothing to do~%")))
(for-each format-whole-file files))
(let ((packages (filter-map (match-lambda
(('argument . spec)