From addf17d792ede7d1ba0545d0644a5fb7b72bdf0a Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Tue, 6 Jan 2009 01:11:24 +0000
Subject: [PATCH] code/commandline.lisp: o Command line parsing now recognizes
 "--" and disables any further   processing by CMUCL itself.  Everything after
 "--" is placed in the   new variable
 EXT:*COMMAND-LINE-APPLICATION-ARGUMENTS*, which is a   list of strings.

code/exports.lisp:
o Export EXT:*COMMAND-LINE-APPLICATION-ARGUMENTS*.

general-info/release-19f.txt:
o Update.
---
 code/commandline.lisp        | 13 +++++++++++--
 code/exports.lisp            |  3 ++-
 general-info/release-19f.txt |  4 ++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/code/commandline.lisp b/code/commandline.lisp
index af17bc52a..e77d58670 100644
--- a/code/commandline.lisp
+++ b/code/commandline.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/commandline.lisp,v 1.16 2008/11/12 15:04:23 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/commandline.lisp,v 1.17 2009/01/06 01:11:23 rtoy Rel $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -14,13 +14,16 @@
 ;;;
 
 (in-package "EXTENSIONS")
-(export '(*command-line-words* *command-line-switches*
+(export '(*command-line-application-arguments* *command-line-words* *command-line-switches*
 	  *command-switch-demons* *command-line-utility-name*
 	  *command-line-strings* *batch-mode*
 	  cmd-switch-string command-line-switch-p
 	  cmd-switch-name cmd-switch-value cmd-switch-words command-line-switch
 	  defswitch cmd-switch-arg get-command-line-switch))
 
+(defvar *command-line-application-arguments* ()
+  "A list of all the command line arguments after --")
+
 (defvar *command-line-switches* ()
   "A list of cmd-switch's representing the arguments used to invoke
   this process.")
@@ -107,10 +110,16 @@
 	      (push (make-cmd-switch switch value (nreverse word-list))
 		    *command-line-switches*)
 	      (return nil))
+	    
 	    (unless (zerop (length (the simple-string str)))
 	      (when (char= #\- (schar str 0))
 		(push (make-cmd-switch switch value (nreverse word-list))
 		      *command-line-switches*)
+		(when (and (= (length str) 2)
+			   (char= #\- (schar str 1)))
+		  ;; Gather up everything after --, and exit.
+		  (setf *command-line-application-arguments* cmd-strings)
+		  (setf str nil))
 		(return nil))
 	      (push str word-list))
 	    (setq str (pop cmd-strings))))))))
diff --git a/code/exports.lisp b/code/exports.lisp
index 6d503f2ac..a1b499bb5 100644
--- a/code/exports.lisp
+++ b/code/exports.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.278 2008/12/31 17:50:01 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.279 2009/01/06 01:11:24 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1385,6 +1385,7 @@
   (:export "*COMMAND-LINE-WORDS*" "*COMMAND-LINE-SWITCHES*"
 	   "*COMMAND-SWITCH-DEMONS*" "*COMMAND-LINE-UTILITY-NAME*"
 	   "*COMMAND-LINE-STRINGS*" "*BATCH-MODE*"
+	   "*COMMAND-LINE-APPLICATION-ARGUMENTS*
 	   "CMD-SWITCH-STRING" "COMMAND-LINE-SWITCH-P"
 	   "CMD-SWITCH-NAME" "CMD-SWITCH-VALUE" "CMD-SWITCH-WORDS" "COMMAND-LINE-SWITCH"
 	   "DEFSWITCH" "CMD-SWITCH-ARG" "GET-COMMAND-LINE-SWITCH")
diff --git a/general-info/release-19f.txt b/general-info/release-19f.txt
index 60686ec16..5f81cfdb7 100644
--- a/general-info/release-19f.txt
+++ b/general-info/release-19f.txt
@@ -44,6 +44,10 @@ New in this release:
       o If the chip supports sse2, but CMUCL can't find the sse2 core,
         CMUCL will try to fall back to the x87 core.  (This only
         happens if -fpu is auto.)
+    - Command line parsing now recognizes the option "--".  Everything
+      after "--" is not subject to CMUCL's command line parsing, and
+      everything after the "--" is placed in the new variable
+      EXT:*COMMAND-LINE-APPLICATION-ARGUMENTS*. 
 
   * ANSI compliance fixes:
     - Fix bug in backquote printer.  If the variable is @foo, we want
-- 
GitLab