From: Mark Wooding Date: Fri, 15 Jun 2007 14:19:29 +0000 (+0100) Subject: frontend: Allow use of new zone machinery. X-Git-Url: https://git.distorted.org.uk/~mdw/zone/commitdiff_plain/122041a01dd0473d0fa603ba59c58bbe9d203fa1 frontend: Allow use of new zone machinery. New options --subnet declares preferred subnets and --directory sets an output directory. Also --feature inserts a keyword into *features* for use by #+/#- reader macros in zone files. --- diff --git a/frontend.lisp b/frontend.lisp index 5241be0..ef9c090 100644 --- a/frontend.lisp +++ b/frontend.lisp @@ -31,11 +31,29 @@ (defvar opt-zones nil "Which zones to be emitted.") +(eval-when (:compile-toplevel :load-toplevel) + (defopthandler dir (var arg) () + (let ((path (probe-file arg))) + (if (and path + (not (pathname-name path))) + (setf var path) + (option-parse-error "path `~A' doesn't name a directory." arg))))) + (define-program :version "1.0.0" :usage "ZONEDEF..." :help "Generates BIND zone files from Lisp descriptions." :options (options help-options + "Parsing options" + (#\f "feature" (:arg "KEYWORD") + (list *features* 'keyword) + "Insert KEYWORD in *features* list.") + (#\s "subnet" (:arg "NET") + (list zone:*preferred-subnets*) + "Designate NET as a preferred subnet.") "Output options" + (#\d "directory" (:arg "DIRECTORY") + (dir *zone-output-path*) + "Write zone and serial files to DIRECTORY.") (#\z "zone" (:arg "NAME") (list opt-zones) "Write information about zone NAME.")))