Commit | Line | Data |
---|---|---|
7e282fb5 | 1 | ;;; -*-lisp-*- |
2 | ;;; | |
3 | ;;; $Id$ | |
4 | ;;; | |
5 | ;;; Zone generator frontend | |
6 | ;;; | |
7 | ;;; (c) 2005 Straylight/Edgeware | |
8 | ;;; | |
9 | ||
10 | ;;;----- Licensing notice --------------------------------------------------- | |
11 | ;;; | |
12 | ;;; This program is free software; you can redistribute it and/or modify | |
13 | ;;; it under the terms of the GNU General Public License as published by | |
14 | ;;; the Free Software Foundation; either version 2 of the License, or | |
15 | ;;; (at your option) any later version. | |
16 | ;;; | |
17 | ;;; This program is distributed in the hope that it will be useful, | |
18 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;;; GNU General Public License for more details. | |
21 | ;;; | |
22 | ;;; You should have received a copy of the GNU General Public License | |
23 | ;;; along with this program; if not, write to the Free Software Foundation, | |
24 | ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
25 | ||
26 | (defpackage #:zone.frontend | |
80055495 | 27 | (:use #:common-lisp #:optparse #:zone) |
7e282fb5 | 28 | (:export #:main)) |
29 | (in-package #:zone.frontend) | |
30 | ||
7e282fb5 | 31 | (defvar opt-zones nil |
32 | "Which zones to be emitted.") | |
33 | ||
f41a8783 MW |
34 | (define-program |
35 | :version "1.0.0" :usage "ZONEDEF..." | |
36 | :help "Generates BIND zone files from Lisp descriptions." | |
37 | :options (options help-opts | |
38 | "Output options" | |
39 | (#\z "zone" (:arg "NAME") (list opt-zones) | |
40 | "Write information about zone NAME."))) | |
7e282fb5 | 41 | |
42 | (defun main () | |
43 | (with-unix-error-reporting () | |
44 | (let ((seq 54) | |
f41a8783 | 45 | (files nil)) |
7e282fb5 | 46 | (unless (option-parse-try |
f41a8783 MW |
47 | (do-options () |
48 | (nil (rest) | |
49 | (when (zerop (length rest)) | |
50 | (option-parse-error "no files to read")) | |
51 | (setf files rest)))) | |
52 | (die-usage)) | |
7e282fb5 | 53 | (dolist (f files) |
54 | (let ((*package* (make-package (format nil "zone.scratch-~A" | |
55 | (incf seq)) | |
56 | :use '(#:common-lisp #:zone)))) | |
57 | (load f :verbose nil :print nil :if-does-not-exist :error))) | |
58 | (zone-save opt-zones)))) | |
59 | ||
60 | ;;;----- That's all, folks -------------------------------------------------- |