X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/lisp/blobdiff_plain/e09b6d1d4ad8756be39b092f1fe72f771cb2296c..02866e072a8ac99b5e639fe79b4a7c6df5f11fdc:/optparse.lisp diff --git a/optparse.lisp b/optparse.lisp index 7819b70..a09c188 100644 --- a/optparse.lisp +++ b/optparse.lisp @@ -23,6 +23,9 @@ ;;; along with this program; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +;;;-------------------------------------------------------------------------- +;;; Packages. + (defpackage #:mdw.optparse (:use #:common-lisp #:mdw.base #:mdw.sys-base #:mdw.str) (:export #:exit #:*program-name* #:*command-line-strings* @@ -45,6 +48,7 @@ (defpackage #:mdw.optparse (in-package #:mdw.optparse) +;;;-------------------------------------------------------------------------- ;;; Standard error-reporting functions. (defun moan (msg &rest args) @@ -55,6 +59,7 @@ (defun die (&rest args) (apply #'moan args) (exit 1)) +;;;-------------------------------------------------------------------------- ;;; The main option parser. (defstruct (option (:predicate optionp) @@ -411,6 +416,7 @@ (defmacro with-unix-error-reporting ((&key) &body body) (error (,cond) (die "~A" ,cond))))) +;;;-------------------------------------------------------------------------- ;;; Standard option handlers. (defmacro defopthandler (name (var &optional (arg (gensym))) @@ -663,6 +669,7 @@ (defmacro options (&rest optlist) (parse-option-form form))) optlist))) +;;;-------------------------------------------------------------------------- ;;; Support stuff for help and usage messages (defun print-text (string