[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
16/20: squash! Simplify '--help'.
From: |
guix-commits |
Subject: |
16/20: squash! Simplify '--help'. |
Date: |
Sun, 4 Jun 2023 17:34:41 -0400 (EDT) |
civodul pushed a commit to branch wip-guix-index
in repository guix.
commit 59df834c3270a4da8942b3c982288641a615ed43
Author: Ludovic Courtès <ludo@gnu.org>
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)))
- branch wip-guix-index created (now 861a4e42e7), guix-commits, 2023/06/04
- 04/20: squash! "--db-path" -> "--database"., guix-commits, 2023/06/04
- 07/20: squash! Don't insert directory if it's already present., guix-commits, 2023/06/04
- 08/20: squash! Remove debugging statements., guix-commits, 2023/06/04
- 12/20: squash! Add one variant of each package (name/version pair)., guix-commits, 2023/06/04
- 13/20: squash! Create database when it doesn't already exist., guix-commits, 2023/06/04
- 16/20: squash! Simplify '--help'.,
guix-commits <=
- 18/20: squash! Optimize 'insert-package'., guix-commits, 2023/06/04
- 19/20: squash! Show output name except for "out"; remove '-d'., guix-commits, 2023/06/04
- 02/20: DRAFT Add 'guix index'., guix-commits, 2023/06/04
- 03/20: squash! Update test., guix-commits, 2023/06/04
- 05/20: squash! Improve error reporting and i18n., guix-commits, 2023/06/04
- 01/20: store: Tolerate non-existent GC root directories., guix-commits, 2023/06/04
- 06/20: squash! "with-method" -> "method", guix-commits, 2023/06/04
- 09/20: squash! Choose system-wide database if it's more recent., guix-commits, 2023/06/04
- 11/20: squash! Keep store prefix in database., guix-commits, 2023/06/04
- 15/20: squash! Rename to 'guix locate'., guix-commits, 2023/06/04