
Raymond Toy pushed to branch issue-379-gnu-style-options at cmucl / cmucl Commits: e2035f3c by Raymond Toy at 2025-02-14T07:28:57-08:00 Additional cleanup of help message and remove old switches In the usage, add that we recognize -- to terminate all the options. This can be followed by any number of application args. When printing the options, print "-foo|--foo argname" all on one line. Remove --help and --version switches since we don't need them now. - - - - - 1ca3b1f2 by Raymond Toy at 2025-02-14T07:38:03-08:00 Some additional cleanups Update the comment about docstrings for switches. We automatically wrap the docstrings anyway, so there aren't any restrictions on line length. Fixed a few typos in the docstrings for --eval and --quiet. - - - - - 1 changed file: - src/code/commandline.lisp Changes: ===================================== src/code/commandline.lisp ===================================== @@ -243,12 +243,12 @@ (lisp::finish-standard-output-streams) (setf start next))))) -;; Docstrings should have lines longer than 72 characters so that we -;; can print out the docstrings nicely on one line for help. -;; | <-- char 72 +;; Docstrings MUST consist of simple text and punctuation and +;; newlines; no special markup is allowed. When help is printed, the +;; help string is automatically filled and wrapped to 80 columns. (defswitch "eval" #'eval-switch-demon "Evaluate the specified Lisp expression during the start up - sequence. the value of the form will not be printed unless it is + sequence. The value of the form will not be printed unless it is wrapped in a form that does output." "expression") @@ -338,7 +338,7 @@ (defswitch "quiet" nil "Causes Lisp to start up silently, disabling printing of the herald - and causing most unnecessary noise, like GC messages,load messages, + and causing most unnecessary noise, like GC messages, load messages, etc. to be suppressed.") (defswitch "debug-lisp-search" nil @@ -351,7 +351,8 @@ (defun help-switch-demon (switch) (declare (ignore switch)) - (format t (intl:gettext "~&Usage: ~A <options>~2%") *command-line-utility-name*) + (format t (intl:gettext "~&Usage: ~A <options> [-- [app-args]*]~2%") + *command-line-utility-name*) (flet ((get-words (s) (declare (string s)) @@ -379,15 +380,11 @@ :key #'car)) (destructuring-bind (name doc arg) s - ;; Print both -switch and --switch - (let ((arg-value (if arg (intl:gettext arg)))) - ;; If there's an arg, print the two switches on separate - ;; lines. Otherwise, we can use one line. - (cond (arg - (format t " -~A ~@[~A~]~%" name arg-value) - (format t " --~A ~@[~A~]~%" name arg-value)) - (t - (format t " -~A, --~A~%" name name)))) + ;; Print both -switch and --switch, and the optional arg + ;; value. + (format t " -~A|--~A ~@[~A~]~%" + name name + (if arg (intl:gettext arg))) ;; Poor man's formatting of the help string (let ((*print-right-margin* 80)) @@ -414,10 +411,6 @@ (defswitch "help" #'help-switch-demon "Print out the command line options and exit") -#+nil -(defswitch "-help" #'help-switch-demon - "Same as -help.") - (defun version-switch-demon (switch) (declare (ignore switch)) (format t "~A~%" (lisp-implementation-version)) @@ -425,10 +418,3 @@ (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. -#+nil -(defswitch "-version" #'version-switch-demon - "Prints the cmucl version and exits; same as -version") - View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/263c0448e8e6888d9bc3d2b... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/263c0448e8e6888d9bc3d2b... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)