X-Git-Url: https://git.distorted.org.uk/~mdw/zone/blobdiff_plain/122041a01dd0473d0fa603ba59c58bbe9d203fa1..8e7c1366598806dff2b2e4fb2016efb5a78f42ec:/frontend.lisp diff --git a/frontend.lisp b/frontend.lisp index ef9c090..1ff3e2f 100644 --- a/frontend.lisp +++ b/frontend.lisp @@ -1,7 +1,5 @@ ;;; -*-lisp-*- ;;; -;;; $Id$ -;;; ;;; Zone generator frontend ;;; ;;; (c) 2005 Straylight/Edgeware @@ -24,12 +22,16 @@ ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. (defpackage #:zone.frontend - (:use #:common-lisp #:optparse #:net #:zone) + (:use #:common-lisp #:optparse #:net #:zone + #+cmu #:mop + #+sbcl #:sb-mop) (:export #:main)) (in-package #:zone.frontend) (defvar opt-zones nil "Which zones to be emitted.") +(defvar opt-format :bind + "Which format to use on output.") (eval-when (:compile-toplevel :load-toplevel) (defopthandler dir (var arg) () @@ -54,6 +56,20 @@ (#\d "directory" (:arg "DIRECTORY") (dir *zone-output-path*) "Write zone and serial files to DIRECTORY.") + (#\F "format" (:arg "FORMAT") + (keyword opt-format + (delete-duplicates + (loop for method in + (generic-function-methods + #'zone:zone-write) + for specs = + (method-specializers method) + if (typep (car specs) + 'eql-specializer) + collect + (eql-specializer-object + (car specs))))) + "Format to use for output.") (#\z "zone" (:arg "NAME") (list opt-zones) "Write information about zone NAME."))) @@ -72,6 +88,6 @@ :use '(#:common-lisp #:net #:zone)))) (load f :verbose nil :print nil :if-does-not-exist :error) (delete-package *package*))) - (zone-save opt-zones)))) + (zone-save opt-zones :format opt-format)))) ;;;----- That's all, folks --------------------------------------------------