guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: transformations: Show '--help-transform' only where applicable.


From: guix-commits
Subject: 01/03: transformations: Show '--help-transform' only where applicable.
Date: Sat, 21 Nov 2020 10:01:12 -0500 (EST)

civodul pushed a commit to branch version-1.2.0
in repository guix.

commit 5b3904116fd599b626fef08edb5826ac7b12caab
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Nov 21 12:14:04 2020 +0100

    transformations: Show '--help-transform' only where applicable.
    
    Fixes <https://bugs.gnu.org/44773>.
    Reported by Florian Pelz <pelzflorian@pelzflorian.de>.
    
    This fixes a regression introduced in
    6701f64f7329cdbeda70bcaf38523c9098e5a938.
    
    * guix/transformations.scm (%transformation-options): Add
    "--help-transform".
    (show-transformation-options-help): Rename to...
    (show-transformation-options-help/detailed): ... this.
    (show-transformation-options-help): New public procedure.
    * guix/scripts/build.scm (show-build-options-help): Remove
    "--help-transform".
    (%standard-build-options): Likewise.
    (show-help): Call 'show-transformation-options-help'.
    * guix/scripts/environment.scm (show-help): Likewise.
    * guix/scripts/graph.scm (show-help): Likewise.
    * guix/scripts/install.scm (show-help): Likewise.
    * guix/scripts/pack.scm (show-help): Likewise.
    * guix/scripts/package.scm (show-help): Likewise.
    * guix/scripts/upgrade.scm (show-help): Likewise.
---
 guix/scripts/build.scm       | 13 +++----------
 guix/scripts/environment.scm |  2 ++
 guix/scripts/graph.scm       |  5 ++++-
 guix/scripts/install.scm     |  2 ++
 guix/scripts/pack.scm        |  2 ++
 guix/scripts/package.scm     |  2 ++
 guix/scripts/upgrade.scm     |  2 ++
 guix/transformations.scm     | 16 ++++++++++++++--
 8 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index cc02063..a959cb8 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -182,8 +182,6 @@ options handled by 'set-build-options-from-command-line', 
and listed in
   (display (G_ "
   -M, --max-jobs=N       allow at most N build jobs"))
   (display (G_ "
-      --help-transform   list package transformation options not shown here"))
-  (display (G_ "
       --debug=LEVEL      produce debugging output at LEVEL")))
 
 (define (set-build-options-from-command-line store opts)
@@ -319,14 +317,7 @@ use '--no-offload' instead~%")))
                     (if c
                         (apply values (alist-cons 'max-jobs c result) rest)
                         (leave (G_ "not a number: '~a' option argument: ~a~%")
-                               name arg)))))
-        (option '("help-transform") #f #f
-                (lambda _
-                  (format #t
-                          (G_ "Available package transformation options:~%"))
-                  (show-transformation-options-help)
-                  (newline)
-                  (exit 0)))))
+                               name arg)))))))
 
 
 ;;;
@@ -383,6 +374,8 @@ Build the given PACKAGE-OR-DERIVATION and return their 
output paths.\n"))
   (newline)
   (show-build-options-help)
   (newline)
+  (show-transformation-options-help)
+  (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
   (display (G_ "
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 2328df9..e435bf0 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -180,6 +180,8 @@ COMMAND or an interactive shell in that environment.\n"))
   (newline)
   (show-build-options-help)
   (newline)
+  (show-transformation-options-help)
+  (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
   (display (G_ "
diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm
index 6874904..ddfc6ba 100644
--- a/guix/scripts/graph.scm
+++ b/guix/scripts/graph.scm
@@ -35,7 +35,8 @@
   #:use-module ((guix diagnostics)
                 #:select (location-file formatted-message))
   #:use-module ((guix transformations)
-                #:select (options->transformation
+                #:select (show-transformation-options-help
+                          options->transformation
                           %transformation-options))
   #:use-module ((guix scripts build)
                 #:select (%standard-build-options))
@@ -546,6 +547,8 @@ Emit a representation of the dependency graph of 
PACKAGE...\n"))
   (display (G_ "
   -L, --load-path=DIR    prepend DIR to the package module search path"))
   (newline)
+  (show-transformation-options-help)
+  (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
   (display (G_ "
diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
index 82f5875..63e625f 100644
--- a/guix/scripts/install.scm
+++ b/guix/scripts/install.scm
@@ -39,6 +39,8 @@ This is an alias for 'guix package -i'.\n"))
   (newline)
   (show-build-options-help)
   (newline)
+  (show-transformation-options-help)
+  (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
   (display (G_ "
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 0b29997..ba9a6dc 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1067,6 +1067,8 @@ last resort for relocation."
 Create a bundle of PACKAGE.\n"))
   (show-build-options-help)
   (newline)
+  (show-transformation-options-help)
+  (newline)
   (display (G_ "
   -f, --format=FORMAT    build a pack in the given FORMAT"))
   (display (G_ "
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index eb2e67a..6faf2ad 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -398,6 +398,8 @@ Install, remove, or upgrade packages in a single 
transaction.\n"))
   (newline)
   (show-build-options-help)
   (newline)
+  (show-transformation-options-help)
+  (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
   (display (G_ "
diff --git a/guix/scripts/upgrade.scm b/guix/scripts/upgrade.scm
index 1ee8937..dcbcb2a 100644
--- a/guix/scripts/upgrade.scm
+++ b/guix/scripts/upgrade.scm
@@ -42,6 +42,8 @@ This is an alias for 'guix package -u'.\n"))
   (newline)
   (show-build-options-help)
   (newline)
+  (show-transformation-options-help)
+  (newline)
   (display (G_ "
   -h, --help             display this help and exit"))
   (display (G_ "
diff --git a/guix/transformations.scm b/guix/transformations.scm
index 30142dd..d49041c 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -508,9 +508,17 @@ to the same package but with #:strip-binaries? #f in its 
'arguments' field."
           (option '("with-debug-info") #t #f
                   (parser 'with-debug-info))
           (option '("without-tests") #t #f
-                  (parser 'without-tests)))))
+                  (parser 'without-tests))
 
-(define (show-transformation-options-help)
+          (option '("help-transform") #f #f
+                  (lambda _
+                    (format #t
+                            (G_ "Available package transformation options:~%"))
+                    (show-transformation-options-help/detailed)
+                    (newline)
+                    (exit 0))))))
+
+(define (show-transformation-options-help/detailed)
   (display (G_ "
       --with-source=[PACKAGE=]SOURCE
                          use SOURCE when building the corresponding package"))
@@ -539,6 +547,10 @@ to the same package but with #:strip-binaries? #f in its 
'arguments' field."
       --without-tests=PACKAGE
                          build PACKAGE without running its tests")))
 
+(define (show-transformation-options-help)
+  "Show basic help for package transformation options."
+  (display (G_ "
+      --help-transform   list package transformation options not shown here")))
 
 (define (options->transformation opts)
   "Return a procedure that, when passed an object to build (package,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]