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
This commit is contained in:
Ludovic Courtès 2023-11-20 14:50:49 +01:00
parent 857f501750
commit c39c89c11e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 2 additions and 0 deletions

View File

@ -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)