changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > demo / demo.lisp

changeset 6: 3d202b181d6c
parent: 8f59e2f1b8c4
child: d8f806f1d327
author: ellis <ellis@rwest.io>
date: Sun, 07 May 2023 01:32:31 -0400
permissions: -rw-r--r--
description: tkup
1 ;; demo.lisp
2 (in-package :demo)
3 
4 (defparameter demo-path (merge-pathnames "cl-demo" (uiop:temporary-directory)))
5 
6 (defvar db-path (merge-pathnames "db" demo-path))
7 
8 (defun cli-opts ()
9  "Returns the top-level CLI options."
10  (list
11  (cli:make-option
12  :string
13  :description "demo app to run"
14  :short-name #\x
15  :long-name "app"
16  :initial-value "client"
17  :env-vars '("DEMO_APP")
18  :key :app)))
19 
20 (defun cli-handler (cmd)
21  "Handler for the `demo' command."
22  (let ((app (cli:getopt cmd :app)))
23  (format t "running: ~A!~%" app)))
24 
25 (defun cli-cmd ()
26  "Our demo command."
27  (cli:make-command
28  :name "demo"
29  :description "A collection of demos"
30  :version "1.0.0"
31  :authors '("ellis <ellis@rwest.io>")
32  :license "WTFPL"
33  :options (cli-opts)
34  :handler #'cli-handler))
35 
36 (defun main ()
37  "A demo of some common-lisp functionality."
38  (cli:run (cli-cmd)))