X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2Fmain%2Fextensions%2Fcli%2Fcli.lisp;h=3ca09835b1f42794ef540f5683cec90c48b39106;hb=687ec5dde86dc5e9a46f1441051d2b1da13c4478;hp=843cf01463e7493b5b9f8784d549db3c63cc2d0b;hpb=cca1c12f7351ff2414bfd582ecb2cad590aa9b51;p=clnl diff --git a/src/main/extensions/cli/cli.lisp b/src/main/extensions/cli/cli.lisp index 843cf01..3ca0983 100644 --- a/src/main/extensions/cli/cli.lisp +++ b/src/main/extensions/cli/cli.lisp @@ -10,4 +10,26 @@ ARGUMENTS AND VALUES: DESCRIPTION: PRIMS returns the primitives used in the CLI extension." - nil) + (list + (list :name :q :type :command :func #'shut-down) + (list :name :load :type :command :args '(t) :func #'load-file) + (list :name :help :type :command :args '((:token :optional)) :precedence 20 :func #'help))) + +(defun shut-down () + (cl-charms/low-level:endwin) + (sb-ext:exit :abort t)) + +(defun load-file (file) + (clnl:boot file)) + +(defun help (&optional token) + (format t + (if (not token) + "Placeholder help facility, try <:help :q> or <:help :load> for information about the commands we accept" + (case token + (:|:Q| ":q quits out of clnl") + (:|:LOAD| + (concatenate 'string + ":load loads up a model into the current clnl instance." + " Try :load \"Wolf Sheep Predation.nlogo\"")) + (t (format nil "Don't have help for ~S" token))))))