1
0
Fork 0

updates to (tekuti boot)

* tekuti/boot.scm (*option-grammar*): Remove repl and gds args, replaced
  by `listen'.
  (parse-options): `listen' causes tekuti to spawn a repl server.
  (boot): No more repl option; we always sit down into the event-loop.
This commit is contained in:
Andy Wingo 2010-10-14 12:09:57 +02:00
parent d3cf39b5c0
commit b9b78f3b8a

View file

@ -29,15 +29,12 @@
(define-module (tekuti boot) (define-module (tekuti boot)
#:use-module (ice-9 format) #:use-module (ice-9 format)
#:use-module (ice-9 getopt-long) #:use-module (ice-9 getopt-long)
#:use-module (ice-9 threads)
#:use-module (tekuti util)
#:use-module (tekuti git) #:use-module (tekuti git)
#:use-module (tekuti mod-lisp) #:use-module (tekuti mod-lisp)
#:export (boot)) #:export (boot))
(define *option-grammar* '((gds) (define *option-grammar* '((listen)
(usage) (usage)
(repl)
(config (value #t) (single-char #\c)) (config (value #t) (single-char #\c))
(version (single-char #\v)) (version (single-char #\v))
(help (single-char #\h)))) (help (single-char #\h))))
@ -53,7 +50,7 @@
(map repr-option *option-grammar*))) (map repr-option *option-grammar*)))
(define (version) (define (version)
(format #t "tekuti version 0.1" (car (program-arguments)))) (format #t "tekuti version 0.1"))
;; krap code ;; krap code
(define (parse-options args) (define (parse-options args)
@ -68,11 +65,8 @@
(begin (begin
(version) (version)
(exit 0))) (exit 0)))
(if (option-ref opts 'gds #f) (if (option-ref opts 'listen #f)
(let ((run-utility (@ (ice-9 gds-client) run-utility))) ((@ (system repl server) spawn-server)))
(make-thread
(lambda ()
(with-backtrace (run-utility))))))
opts)) opts))
(define (boot args) (define (boot args)
@ -85,8 +79,4 @@
(set-current-module config-module) (set-current-module config-module)
(primitive-load config)))))) (primitive-load config))))))
(ensure-git-repo) (ensure-git-repo)
(if (option-ref options 'repl #f) (event-loop)))
(begin (make-thread event-loop)
(scm-style-repl))
(event-loop))))