Update more things
This commit is contained in:
+12
-3
@@ -1,10 +1,11 @@
|
||||
(ql:quickload '(:myoji-accent))
|
||||
|
||||
(myoji-accent/accent:initialize-connection)
|
||||
|
||||
(defparameter *interface* "localhost")
|
||||
(defparameter *port* 8080)
|
||||
(defparameter *debug* nil)
|
||||
(defparameter *db-path* (merge-pathnames
|
||||
(uiop:pathname-directory-pathname *load-truename*)
|
||||
"myoji.sqlite"))
|
||||
(defparameter *help* nil)
|
||||
|
||||
(defun parse-arguments (&optional (args (uiop:command-line-arguments)))
|
||||
@@ -20,6 +21,9 @@
|
||||
(when (member (car arg) '("-p" "--port") :test 'equal)
|
||||
(require-arg arg)
|
||||
(setq *port* (parse-integer (second arg))))
|
||||
(when (member (car arg) '("-b" "--db") :test 'equal)
|
||||
(require-arg arg)
|
||||
(setq *db-path* (parse-integer (second arg))))
|
||||
(when (member (car arg) '("-d" "--debug") :test 'equal)
|
||||
(setq *debug* t))))
|
||||
args))
|
||||
@@ -28,6 +32,7 @@
|
||||
(format t "usage: sbcl --load ~a~%" *load-pathname*)
|
||||
(format t " -h|--help print this message, then exit~%")
|
||||
(format t " -d|--debug enable debug output~%")
|
||||
(format t " -b|--db path to the database (takes an argument)~%")
|
||||
(format t " -p|--port the port to use (takes an argument)~%")
|
||||
(format t " -i|--interface the address to bind to (takes an argument)~%")
|
||||
(uiop:quit))
|
||||
@@ -35,4 +40,8 @@
|
||||
(parse-arguments)
|
||||
(if *help*
|
||||
(print-help)
|
||||
(reblocks/server:start :interface *interface* :port *port* :debug *debug*))
|
||||
(progn
|
||||
(format t "Loading database from ~s~%" *db-path*)
|
||||
(myoji-accent/accent:initialize-connection *db-path*)
|
||||
(format t "Starting server on ~s:~s~%" *interface* *port*)
|
||||
(reblocks/server:start :interface *interface* :port *port* :debug *debug*)))
|
||||
|
||||
Reference in New Issue
Block a user