From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:40744) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm2X-0007l1-8w for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irm2R-0008MZ-W0 for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irm2R-0008M6-Re for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irm2R-0000HZ-QN for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 Subject: [bug#38678] [PATCH v4 5/6] repl: Add '--load-path' option. Resent-Message-ID: From: zimoun Date: Wed, 15 Jan 2020 18:00:05 +0100 Message-Id: <20200115170006.24892-5-zimon.toutoune@gmail.com> In-Reply-To: <20200115170006.24892-1-zimon.toutoune@gmail.com> References: <20200115170006.24892-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38678@debbugs.gnu.org Cc: zimoun * guix/scripts/repl.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. --- doc/guix.texi | 8 ++++++++ guix/scripts/repl.scm | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 00eb85a4f7..ef6d1fc178 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7995,6 +7995,14 @@ Accept connections on localhost on port 37146. @item --listen=unix:/tmp/socket Accept connections on the Unix-domain socket @file{/tmp/socket}. @end table + +@item --load-path=@var{directory} +@itemx -L @var{directory} +Add @var{directory} to the front of the package module search path +(@pxref{Package Modules}). + +This allows users to define their own packages and make them visible to +the command-line tool. @end table @c ********************************************************************* diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm index e1cc759fc8..39a9b09656 100644 --- a/guix/scripts/repl.scm +++ b/guix/scripts/repl.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2019 Ludovic Courtès +;;; Copyright © 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +20,7 @@ (define-module (guix scripts repl) #:use-module (guix ui) #:use-module (guix scripts) + #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix repl) #:use-module (guix utils) #:use-module (guix packages) @@ -52,7 +54,10 @@ (alist-cons 'type (string->symbol arg) result))) (option '("listen") #t #f (lambda (opt name arg result) - (alist-cons 'listen arg result))))) + (alist-cons 'listen arg result))) + (find (lambda (option) + (member "load-path" (option-names option))) + %standard-build-options))) (define (show-help) @@ -60,6 +65,8 @@ Start a Guile REPL in the Guix execution environment.\n")) (display (G_ " -t, --type=TYPE start a REPL of the given TYPE")) + (display (G_ " + -L, --load-path=DIR prepend DIR to the package module search path")) (newline) (display (G_ " -h, --help display this help and exit")) -- 2.23.0