civodul pushed a commit to branch wip-guix-index
in repository guix.
commit 59df834c3270a4da8942b3c982288641a615ed43
Author: Ludovic Courtès <[email protected]>
AuthorDate: Sun Jun 4 18:29:30 2023 +0200
squash! Simplify '--help'.
---
guix/scripts/locate.scm | 48 ++++++++++++++----------------------------------
1 file changed, 14 insertions(+), 34 deletions(-)
diff --git a/guix/scripts/locate.scm b/guix/scripts/locate.scm
index 5040c323a4..3fa598f1e9 100644
--- a/guix/scripts/locate.scm
+++ b/guix/scripts/locate.scm
@@ -460,43 +460,19 @@ user or system."
user-database-file))))))
(define (show-help)
- (display (G_ "Usage: guix locate [OPTIONS...] [search FILE...]
-Without argument, indexes (package, file) relationships from the machine.
-This allows indexation with 2 methods, out of the local:
-
-- manifests: This is the fastest implementation with the caveat of indexing
-less packages. That'd be typically the use case of user local indexation.
-
-- store: This is slowest implementation. It discusses with the store
-daemon. That'd be typically the use case of building the largest db in one of
-the build farm node.
-
-With 'search FILE', search for packages installing FILE.\n
-Note: Internal cache is located at ~/.cache/guix/index/db.sqlite by default.
-See --database for customization.\n"))
- (newline)
- (display (G_ "The valid values for OPTIONS are:"))
- (newline)
+ (display (G_ "Usage: guix locate [OPTIONS...] FILE...
+Locate FILE and return the package(s) that contain it.\n"))
(display (G_ "
- -h, --help Display this help and exit"))
- (display (G_ "
- -V, --version Display version information and exit"))
- (display (G_ "
- --database=DIR Change default location of the cache db"))
+ --database=FILE store the database in FILE"))
(newline)
(display (G_ "
- --method=METH Change default indexation method. By default it uses the
- local \"manifests\" (faster). It can also uses the local
- \"store\" (slower, typically on the farm build ci)."))
- (newline)
- (display (G_ "The valid values for ARGS are:"))
+ --method=METHOD use METHOD to select packages to index; METHOD can
+ be 'manifests' (fast) or 'store' (slower)"))
(newline)
(display (G_ "
- search FILE Search for packages installing the FILE (from cache db)"))
- (newline)
+ -h, --help display this help and exit"))
(display (G_ "
- <EMPTY> Without any argument, it index packages. This fills in the
- db cache using whatever indexation method is defined."))
+ -V, --version display version information and exit"))
(show-bug-report-information))
(define %options
@@ -557,9 +533,13 @@ See --database for customization.\n"))
;; Migrate/initialize db to schema at version application-version
(migrate-schema-to-version database)
;; Finally index packages
- (if (eq? method 'manifests)
- (index-packages-from-manifests-with-db database)
- (index-packages-from-store-with-db database)))
+ (match method
+ ('manifests
+ (index-packages-from-manifests-with-db database))
+ ('store
+ (index-packages-from-store-with-db database))
+ (_
+ (leave (G_ "~a: unknown indexing method~%") method))))
;; Populate the database if needed.
(let ((stat (stat database #f)))