From 69d9a020949c77c77b449c1faf04397b95eef5b7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 Nov 2023 18:12:24 +0100 Subject: locate: Accept ‘--clear’ without additional arguments. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a bug whereby ‘guix locate --clear’ would end with the “no files to search for” error. Fixes . * guix/scripts/locate.scm (guix-locate): Do not emit “no files to search for” error when 'clear? is set in OPTS. * tests/guix-locate.sh: Test it. Reported-by: Maciej Kalandyk Change-Id: Ib8fa125c18481d7f5408bd89df9503713527641d --- tests/guix-locate.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/guix-locate.sh') diff --git a/tests/guix-locate.sh b/tests/guix-locate.sh index 43f8ba53b0..de0ea5769d 100755 --- a/tests/guix-locate.sh +++ b/tests/guix-locate.sh @@ -70,3 +70,9 @@ then $cmd_store guile | grep "$(guix build guile-bootstrap)/bin/guile" $cmd_store boot-9.scm | grep ^guile-bootstrap fi + +# The command below is an error: "no files to search for"... +guix locate && false + +# ... but this one is fine. +guix locate --clear -- cgit v1.2.3