changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > demo / demo.lisp

changeset 2: 04ac94b03a26
parent: eb8ed24e8a76
child: 8f59e2f1b8c4
author: ellis <ellis@rwest.io>
date: Sun, 30 Apr 2023 22:25:43 -0400
permissions: -rw-r--r--
description: rm extra build.py
1 ;; demo.lisp
2 (in-package :cl-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 app: ~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 (demo/opts)
34  :handler #'demo/handler))
35 
36 (defun main ()
37  "A demo of some common-lisp functionality."
38  (cli:run (demo/cmd)))