CLI moved from curses to opengl
[clnl] / src / main / extensions / cli / cli.lisp
1 (in-package #:clnl-extension-cli)
2
3 (defun prims ()
4  "PRIMS => PRIMS
5
6 ARGUMENTS AND VALUES:
7
8   PRIMS: Primitives defined for this extension
9
10 DESCRIPTION:
11
12   PRIMS returns the primitives used in the CLI extension."
13  (list
14   (list :name :q :type :command :func #'shut-down)
15   (list :name :load :type :command :args '(t) :func #'load-file)
16   (list :name :help :type :command :args '((:token :optional)) :precedence 20 :func #'help)))
17
18 (defun shut-down ()
19  (sb-ext:exit :abort t))
20
21 (defun load-file (file)
22  (clnl:boot file))
23
24 (defun help (&optional token)
25  (format t
26   (if (not token)
27    "Placeholder help facility, try <:help :q> or <:help :load> for information about the commands we accept"
28    (case token
29     (:|:Q| ":q quits out of clnl")
30     (:|:LOAD|
31      (concatenate 'string
32       ":load <filename> loads up a model into the current clnl instance."
33       " Try :load \"Wolf Sheep Predation.nlogo\""))
34     (t (format nil "Don't have help for ~S" token))))))