diff options
-rw-r--r-- | oneliners.api.asd | 18 | ||||
-rw-r--r-- | src/run.lisp | 15 |
2 files changed, 19 insertions, 14 deletions
diff --git a/oneliners.api.asd b/oneliners.api.asd index 0423edb..4bf1fa7 100644 --- a/oneliners.api.asd +++ b/oneliners.api.asd @@ -1,5 +1,5 @@ (defsystem "oneliners.api" - :version "0.1.0" + :version "0.2.0" :author "Colin Okay" :license "AGPLv3" :depends-on ("lazybones-hunchentoot" @@ -13,17 +13,7 @@ :components ((:file "package") (:file "util") - (:file "main")))) - :description "" - :in-order-to ((test-op (test-op "oneliners.api/tests")))) + (:file "main") + (:file "run")))) + :description "") -(defsystem "oneliners.api/tests" - :author "Colin Okay" - :license "AGPLv3" - :depends-on ("oneliners.api" - "rove") - :components ((:module "tests" - :components - ((:file "main")))) - :description "Test system for oneliners.api" - :perform (test-op (op c) (symbol-call :rove :run c))) diff --git a/src/run.lisp b/src/run.lisp new file mode 100644 index 0000000..677d46c --- /dev/null +++ b/src/run.lisp @@ -0,0 +1,15 @@ +;;;; run.lisp -- starting from the command line. + +(in-package :oneliners.api) + +(defun get-option (name &optional default) + (or + (let ((args (uiop:command-line-arguments))) + (a:when-let ((pos (position name args :test #'string-equal))) + (nth (1+ pos) args))) + default)) + +(defun run () + (a:if-let ((conf-file (get-option "--config"))) + (start-from-config conf-file) + (start-from-config))) |