edit: Add '--load-path' option.
authorzimoun <zimon.toutoune@gmail.com>
Wed, 15 Jan 2020 17:00:04 +0000 (18:00 +0100)
committerPierre Neidhardt <mail@ambrevar.xyz>
Thu, 16 Jan 2020 14:27:24 +0000 (15:27 +0100)
* guix/scripts/edit.scm (%option): Add '--load-path' option.
* doc/guix.texi: Document it.

doc/guix.texi
guix/scripts/edit.scm

index a05ea17..87ad121 100644 (file)
@@ -8706,6 +8706,10 @@ have created your own packages on @code{GUIX_PACKAGE_PATH}
 recipes.  In other cases, you will be able to examine the read-only recipes
 for packages currently in the store.
 
+Instead of @code{GUIX_PACKAGE_PATH}, the command-line option
+@code{--load-path=@var{directory}} (or in short @code{-L
+@var{directory}}) allows you to add @var{directory} to the front of the
+package module search path and so make your own packages visible.
 
 @node Invoking guix download
 @section Invoking @command{guix download}
index da3d277..a6fd1d2 100644 (file)
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (guix scripts edit)
   #:use-module (guix ui)
   #:use-module (guix scripts)
+  #:use-module ((guix scripts build) #:select (%standard-build-options))
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (srfi srfi-1)
             guix-edit))
 
 (define %options
-  (list (option '(#\h "help") #f #f
+  (list (find (lambda (option)
+                (member "load-path" (option-names option)))
+              %standard-build-options)
+        (option '(#\h "help") #f #f
                 (lambda args
                   (show-help)
                   (exit 0)))
@@ -39,6 +44,9 @@
 (define (show-help)
   (display (G_ "Usage: guix edit PACKAGE...
 Start $VISUAL or $EDITOR to edit the definitions of PACKAGE...\n"))
+  (newline)
+  (display (G_ "
+  -L, --load-path=DIR    prepend DIR to the package module search path"))
   (newline)
   (display (G_ "
   -h, --help             display this help and exit"))