changeset 16092:439578110829

(command-line, command-line-1): Stop processing options if we encounter "--".
author Richard M. Stallman <rms@gnu.org>
date Tue, 03 Sep 1996 21:51:08 +0000
parents d76a0697d12e
children 4c74d7f1cfa6
files lisp/startup.el
diffstat 1 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Tue Sep 03 21:48:13 1996 +0000
+++ b/lisp/startup.el	Tue Sep 03 21:51:08 1996 +0000
@@ -483,15 +483,16 @@
 		 (string-match "=" argi))
 	    (setq argval (substring argi (match-end 0))
 		  argi (substring argi 0 (match-beginning 0))))
-	(let ((completion (try-completion argi longopts)))
-	  (if (eq completion t)
-	      (setq argi (substring argi 1))
-	    (if (stringp completion)
-		(let ((elt (assoc completion longopts)))
-		  (or elt
-		      (error "Option `%s' is ambiguous" argi))
-		  (setq argi (substring (car elt) 1)))
-	      (setq argval nil))))
+	(or (equal argi "--")
+	    (let ((completion (try-completion argi longopts)))
+	      (if (eq completion t)
+		  (setq argi (substring argi 1))
+		(if (stringp completion)
+		    (let ((elt (assoc completion longopts)))
+		      (or elt
+			  (error "Option `%s' is ambiguous" argi))
+		      (setq argi (substring (car elt) 1)))
+		  (setq argval nil)))))
 	(cond
 	 ((or (string-equal argi "-q")
 	      (string-equal argi "-no-init-file"))
@@ -787,8 +788,9 @@
     (let ((dir command-line-default-directory)
 	  (file-count 0)
 	  first-file-buffer
+	  done
 	  (line 0))
-      (while command-line-args-left
+      (while (and command-line-args-left (not done))
 	(let* ((argi (car command-line-args-left))
 	       (orig-argi argi)
 	       ;; This includes our standard options' long versions
@@ -818,7 +820,9 @@
 	  (if (string-match "^--[^=]*=" argi)
 	      (setq argval (substring argi (match-end 0))
 		    argi (substring argi 0 (1- (match-end 0)))))
-	  (setq completion (try-completion argi longopts))
+	  (if (equal argi "--")
+	      (setq completion nil)
+	    (setq completion (try-completion argi longopts)))
 	  (if (eq completion t)
 	      (setq argi (substring argi 1))
 	    (if (stringp completion)
@@ -891,6 +895,8 @@
 		 ;; Ignore X-windows options and their args if not using X.
 		 (setq command-line-args-left
 		       (nthcdr (nth 1 tem) command-line-args-left)))
+		((equal argi "--")
+		 (setq done t))
 		(t
 		 ;; We have almost exhausted our options. See if the
 		 ;; user has made any other command-line options available