From 91fae8571748ff55d0cfcc4c51be673fe56f7209 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Sat, 26 Feb 2022 15:54:09 -0600 Subject: added run module --- src/run.lisp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/run.lisp (limited to 'src') 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))) -- cgit v1.2.3