Raymond Toy pushed to branch master at cmucl / cmucl
Commits: ca9b6e0c by Raymond Toy at 2023-03-01T03:43:18+00:00 Fix #163: Add -version command line switch
- - - - - 3f4e2d0c by Raymond Toy at 2023-03-01T03:43:19+00:00 Merge branch 'issue-163-add-command-line-version' into 'master'
Fix #163: Add -version command line switch
Closes #163
See merge request cmucl/cmucl!112 - - - - -
3 changed files:
- src/code/commandline.lisp - src/code/save.lisp - src/i18n/locale/cmucl.pot
Changes:
===================================== src/code/commandline.lisp ===================================== @@ -394,3 +394,17 @@
(defswitch "-help" #'help-switch-demon "Same as -help.") + +(defun version-switch-demon (switch) + (declare (ignore switch)) + (format t "~A~%" (lisp-implementation-version)) + (ext:quit)) + +(defswitch "version" #'version-switch-demon + "Prints the cmucl version and exits") + +;; Make --version work for the benefit of those who are accustomed to +;; GNU software. +(defswitch "-version" #'version-switch-demon + "Prints the cmucl version and exits; same as -version") +
===================================== src/code/save.lisp ===================================== @@ -336,8 +336,12 @@ *gc-verbose* nil)) (when (and process-command-line (or (find-switch "help") - (find-switch "-help"))) - ;; Don't load any init files if -help or --help is given + (find-switch "-help") + (find-switch "version") + (find-switch "-version"))) + ;; Don't load any init files if -help, --help, + ;; -version, or --version is given. These exit right + ;; away, so loading the init file is wasteful. (setf site-init nil) (setf load-init-file nil)) (when (and site-init
===================================== src/i18n/locale/cmucl.pot ===================================== @@ -6149,6 +6149,10 @@ msgstr "" msgid "Same as -help." msgstr ""
+#: src/code/commandline.lisp +msgid "Prints the cmucl version and exits" +msgstr "" + #: src/code/env-access.lisp msgid "" "Returns information about the symbol VAR in the lexical environment ENV.\n"
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/68ef4c5b2708fd3c26e93d3...