start making file source configurable

This commit is contained in:
2026-01-05 14:11:56 -05:00
parent 6a2ab4b673
commit 59d50a694b
4 changed files with 40 additions and 13 deletions

View File

@@ -4,19 +4,37 @@
(defparameter *chronostory-gacha-search-format* "https://chronostory.onrender.com/api/gacha-search?itemId=~a")
(defparameter *chronostory-gacha-url-format "https://chronostory.onrender.com/api/gacha-items?gachaId=~a")
(defun main ()
(sb-ext:disable-debugger)
(let ((program-name (car sb-ext:*posix-argv*))
(args (rest sb-ext:*posix-argv*)))
(when (member "--fail" args :test #'string=)
(error "Simulated error!"))
(when (member "--version" args :test #'string=)
(let ((write-time (file-write-date program-name)))
(defun print-version-information ()
(let* ((program-name (car sb-ext:*posix-argv*))
(write-time (file-write-date program-name)))
(multiple-value-bind (second minute hour date month year)
(decode-universal-time write-time)
(let ((dt (format nil "~4,'0d-~2,'0d-~2,'0d ~2,'0d:~2,'0d:~2,'0d"
year month date hour minute second)))
(format t "lispostory, created ~a~%" dt)))))))
(format t "lispostory, created ~a~%" dt)))))
(defun get-arg (opt args)
"Get's the argument for a given command line option. Expects <program opt arg>"
(loop :for (current next) :on args
:while next
:when (string-equal current opt)
:return next))
(defun refresh-data (data-type)
(string-case data-type
("drops" (refresh (make-drop-data-source)))
("items" (refresh (make-item-data-source)))
("mobs" (refresh (make-mob-data-source)))
("spawns" (refresh (make-spawn-data-source)))))
(defun main ()
(sb-ext:disable-debugger)
(let ((args (rest sb-ext:*posix-argv*)))
(when (find-string "--fail" args)
(error "Simulated error!"))
(when (find-string "--version" args)
(print-version-information))
(when-let ((arg (get-arg "refresh"))))))
(defun create-exe-and-die ()
(sb-ext:save-lisp-and-die