blob: 9ce802622582873d6d7d12e93af4233b3e53f205 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
;; This file is part of Idest
;; Copyright (C) 2011 Sergey Poznyakoff
;; Idest is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; Idest is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Idest. If not, see <http://www.gnu.org/licenses/>.
(define-module (format))
(use-modules (guile-user))
(let ((cmd (command-line))
(mod-pathname #f)
(saved-load-hook %load-hook))
(set! %load-hook (lambda (filename)
(set! mod-pathname filename)
(set! %load-hook saved-load-hook)))
(let ((mod-name (list-ref cmd 1)))
(set-program-arguments (list-tail cmd 1))
(set! idest-main
(module-ref
(resolve-module (list 'idest 'format (string->symbol mod-name)))
'idest-main))
(if (not idest-readonly)
(error (format #f "~A wants to modify files!" mod-pathname)))))
|