From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Todd Newsgroups: gmane.lisp.guile.devel Subject: -I for guile command line Date: Thu, 1 Jul 2004 20:35:07 -0500 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <0CB8AB8A-CBC8-11D8-A9B1-000A95CD5044@mac.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v618) Content-Type: multipart/mixed; boundary=Apple-Mail-5-903241478 X-Trace: sea.gmane.org 1088732158 15516 80.91.224.253 (2 Jul 2004 01:35:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Jul 2004 01:35:58 +0000 (UTC) Cc: Richard Todd Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 02 03:35:50 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BgCxx-0003Ns-00 for ; Fri, 02 Jul 2004 03:35:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BgCzk-0004zu-AV for guile-devel@m.gmane.org; Thu, 01 Jul 2004 21:37:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BgCzb-0004x5-Bx for guile-devel@gnu.org; Thu, 01 Jul 2004 21:37:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BgCzZ-0004wN-Nv for guile-devel@gnu.org; Thu, 01 Jul 2004 21:37:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BgCzZ-0004wK-KS for guile-devel@gnu.org; Thu, 01 Jul 2004 21:37:29 -0400 Original-Received: from [17.250.248.89] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BgCxL-0006mm-0l for guile-devel@gnu.org; Thu, 01 Jul 2004 21:35:11 -0400 Original-Received: from mac.com (smtpin01-en2 [10.13.10.146]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id i621Z92G000714 for ; Thu, 1 Jul 2004 18:35:09 -0700 (PDT) Original-Received: from [10.0.1.3] (97.157.171.66.subscriber.vzavenue.net [66.171.157.97]) (authenticated bits=0) by mac.com (Xserve/smtpin01/MantshX 4.0) with ESMTP id i621Z7Tw024086 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Thu, 1 Jul 2004 18:35:09 -0700 (PDT) Original-To: guile-devel@gnu.org X-Mailer: Apple Mail (2.618) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3825 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3825 --Apple-Mail-5-903241478 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed any interest in this patch? It lets you put -I on the guile command line, to add directories to the load path. as in: guile -I .. -I . script-in-development.scm I find this easier than mucking with that environment variable. --Apple-Mail-5-903241478 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="dash_i.patch" Content-Disposition: attachment; filename=dash_i.patch Index: libguile/script.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/script.c,v retrieving revision 1.61 diff -u -r1.61 script.c --- libguile/script.c 16 Jun 2004 04:08:25 -0000 1.61 +++ libguile/script.c 2 Jul 2004 01:29:05 -0000 @@ -361,6 +361,7 @@ "remaining arguments as the value of (command-line).\n" "If FILE begins with `-' the -s switch is mandatory.\n" "\n" + " -I DIRECTORY add DIRECTORY to the module load path\n" " -l FILE load Scheme source code from FILE\n" " -e FUNCTION after reading script, apply FUNCTION to\n" " command line arguments\n" @@ -395,7 +396,10 @@ SCM_SYMBOL (sym_top_repl, "top-repl"); SCM_SYMBOL (sym_quit, "quit"); SCM_SYMBOL (sym_use_srfis, "use-srfis"); - +SCM_SYMBOL (sym_load_path, "%load-path"); +SCM_SYMBOL (sym_set_x, "set!"); +SCM_SYMBOL (sym_cons, "cons"); + /* Given an array of command-line switches, return a Scheme expression to carry out the actions specified by the switches. @@ -485,6 +489,18 @@ break; } + else if (! strcmp (argv[i], "-I")) + { + if (++i < argc) + tail = scm_cons (SCM_LIST3 (sym_set_x, sym_load_path, + SCM_LIST3 (sym_cons, + scm_makfrom0str(argv[i]), + sym_load_path)), + tail); + else + scm_shell_usage (1, "missing argument to -I switch"); + } + else if (! strcmp (argv[i], "-l")) /* load a file */ { if (++i < argc) --Apple-Mail-5-903241478 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --Apple-Mail-5-903241478--