diff options
author | Colin Okay <okay@toyful.space> | 2022-02-26 15:54:09 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-02-26 15:54:09 -0600 |
commit | 91fae8571748ff55d0cfcc4c51be673fe56f7209 (patch) | |
tree | efe09dec76b7662fe44c4ebfc78a4427d89b37a3 /src | |
parent | 3fa00f78b3b1da9dcb58913f4faf9011291fd52d (diff) |
added run module
Diffstat (limited to 'src')
-rw-r--r-- | src/run.lisp | 15 |
1 files changed, 15 insertions, 0 deletions
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))) |