X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/7bfe3a370a6a56a0f097fc1e357ca8ac798d9d4b..4ac20e3bbed1cba5c16d4573431db20a84d5e28b:/src/optparse.lisp diff --git a/src/optparse.lisp b/src/optparse.lisp index fc46ba4..70bb012 100644 --- a/src/optparse.lisp +++ b/src/optparse.lisp @@ -24,7 +24,7 @@ ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. (cl:defpackage #:optparse - (:use #:common-lisp #:sod-utilities)) + (:use #:common-lisp #:cl-launch #:sod-utilities)) (cl:in-package #:optparse) @@ -62,21 +62,13 @@ Set `*command-line*' and `*program-name*'." (setf *command-line* - (or (when (member :cl-launch *features*) - (let* ((cllpkg (find-package :cl-launch)) - (name (funcall (intern "GETENV" cllpkg) - "CL_LAUNCH_FILE")) - (args (symbol-value (intern "*ARGUMENTS*" cllpkg)))) - (if name - (cons name args) - args))) - #+sbcl sb-ext:*posix-argv* - #+cmu ext:*command-line-strings* - #+clisp (loop with argv = (ext:argv) - for i from 7 below (length argv) - collect (aref argv i)) - #+ecl (loop from i below (ext:argc) collect (ext:argv i)) - '("")) + (cons (or (getenv "CL_LAUNCH_FILE") + #+sbcl (car sb-ext:*posix-argv*) + #+cmu (car ext:*command-line-strings*) + #+clisp (aref (ext:argv) 0) + #+ecl (ext:argv 0) + #-(or sbcl cmu clisp ecl) "sod") + *arguments*) *program-name* (pathname-name (car *command-line*))))