chiark
/
gitweb
/
~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/frontend.lisp: Make the option parser available in a special variable.
[sod]
/
src
/
frontend.lisp
diff --git
a/src/frontend.lisp
b/src/frontend.lisp
index 7648e2d69ed11f4e7a6c367207b722819953d3cb..d3d9d9db2bddc7573b6920c75ebcac42817cb6ee 100644
(file)
--- a/
src/frontend.lisp
+++ b/
src/frontend.lisp
@@
-24,7
+24,7
@@
;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
(cl:defpackage #:sod-frontend
;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
(cl:defpackage #:sod-frontend
- (:use #:common-lisp #:optparse #:sod #:sod-parser)
+ (:use #:common-lisp #:
sod-utilities #:
optparse #:sod #:sod-parser)
(:shadowing-import-from #:optparse #:int))
(cl:in-package #:sod-frontend)
(:shadowing-import-from #:optparse #:int))
(cl:in-package #:sod-frontend)
@@
-38,6
+38,9
@@
(exercise)
;;;--------------------------------------------------------------------------
;;; The main program.
;;;--------------------------------------------------------------------------
;;; The main program.
+(defvar-unbound *option-parser*
+ "The program's main option parser.")
+
(eval-when (:compile-toplevel :load-toplevel :execute)
(defopthandler dirpath (var arg) ()
"Convert the argument into a pathname with a directory component
(eval-when (:compile-toplevel :load-toplevel :execute)
(defopthandler dirpath (var arg) ()
"Convert the argument into a pathname with a directory component
@@
-113,12
+116,13
@@
(define-program
(list output-reasons 'keyword))))
;; Actually parse the options.
(list output-reasons 'keyword))))
;; Actually parse the options.
- (unless (and (option-parse-try
- (do-options ()
- (nil (rest)
- (setf args rest))))
- (or builtinsp args))
- (die-usage))
+ (let ((*option-parser* (make-option-parser)))
+ (unless (and (option-parse-try
+ (do-options (:parser *option-parser*)
+ (nil (rest)
+ (setf args rest))))
+ (or builtinsp args))
+ (die-usage)))
;; Do the main parsing job.
(labels ((hack-module (module)
;; Do the main parsing job.
(labels ((hack-module (module)