/[cmucl]/src/code/commandline.lisp
ViewVC logotype

Diff of /src/code/commandline.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15.20.1 by rtoy, Fri Dec 19 01:31:32 2008 UTC revision 1.15.20.2 by rtoy, Wed Mar 18 15:37:28 2009 UTC
# Line 14  Line 14 
14  ;;;  ;;;
15    
16  (in-package "EXTENSIONS")  (in-package "EXTENSIONS")
17  (export '(*command-line-words* *command-line-switches*  (export '(*command-line-application-arguments* *command-line-words* *command-line-switches*
18            *command-switch-demons* *command-line-utility-name*            *command-switch-demons* *command-line-utility-name*
19            *command-line-strings* *batch-mode*            *command-line-strings* *batch-mode*
20            cmd-switch-string command-line-switch-p            cmd-switch-string command-line-switch-p
21            cmd-switch-name cmd-switch-value cmd-switch-words command-line-switch            cmd-switch-name cmd-switch-value cmd-switch-words command-line-switch
22            defswitch cmd-switch-arg get-command-line-switch))            defswitch cmd-switch-arg get-command-line-switch))
23    
24    (defvar *command-line-application-arguments* ()
25      "A list of all the command line arguments after --")
26    
27  (defvar *command-line-switches* ()  (defvar *command-line-switches* ()
28    "A list of cmd-switch's representing the arguments used to invoke    "A list of cmd-switch's representing the arguments used to invoke
29    this process.")    this process.")
# Line 107  Line 110 
110                (push (make-cmd-switch switch value (nreverse word-list))                (push (make-cmd-switch switch value (nreverse word-list))
111                      *command-line-switches*)                      *command-line-switches*)
112                (return nil))                (return nil))
113    
114              (unless (zerop (length (the simple-string str)))              (unless (zerop (length (the simple-string str)))
115                (when (char= #\- (schar str 0))                (when (char= #\- (schar str 0))
116                  (push (make-cmd-switch switch value (nreverse word-list))                  (push (make-cmd-switch switch value (nreverse word-list))
117                        *command-line-switches*)                        *command-line-switches*)
118                    (when (and (= (length str) 2)
119                               (char= #\- (schar str 1)))
120                      ;; Gather up everything after --, and exit.
121                      (setf *command-line-application-arguments* cmd-strings)
122                      (setf str nil))
123                  (return nil))                  (return nil))
124                (push str word-list))                (push str word-list))
125              (setq str (pop cmd-strings))))))))              (setq str (pop cmd-strings))))))))

Legend:
Removed from v.1.15.20.1  
changed lines
  Added in v.1.15.20.2

  ViewVC Help
Powered by ViewVC 1.1.5