Skip to content

Commit 37fd014

Browse files
committed
feat: add eval command
1 parent c68b6e3 commit 37fd014

File tree

6 files changed

+57
-0
lines changed

6 files changed

+57
-0
lines changed

cmds/core/eval.lisp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
;;;; cmds/core/eval.lisp --- Evaluate lisp form with a proper PATH
2+
3+
;;; Commentary
4+
;;
5+
;; The `eval' command definition.
6+
;;
7+
8+
;;; Code
9+
10+
(defpackage qob-cli/eval
11+
(:use cl)
12+
(:export command))
13+
14+
(in-package :qob-cli/eval)
15+
16+
(defun options ()
17+
"Options for `eval' command."
18+
(list ))
19+
20+
(defun handler (cmd)
21+
"Handler for `eval' command."
22+
(qob-cli:call-script "core/eval" cmd))
23+
24+
(defun command ()
25+
"The `eval' command."
26+
(clingon:make-command
27+
:name "eval"
28+
:description "Evaluate lisp form with a proper PATH"
29+
:options (options)
30+
:handler #'handler))
31+
32+
;;; End of cmds/core/eval.lisp

cmds/qob.lisp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
,(qob-cli/clean:command)
6060
,(qob-cli/create:command)
6161
,(qob-cli/dists:command)
62+
,(qob-cli/eval:command)
6263
,(qob-cli/files:command)
6364
,(qob-cli/package:command)
6465
,(qob-cli/info:command)

docs/content/Getting-Started/Basic-Usage/_index.en.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ COMMANDS:
4444
clean Delete various files produced during building
4545
create Create a new Common Lisp project
4646
dists List out all installed dists
47+
eval Evaluate lisp form with a proper PATH
4748
files Print all system files
4849
package Build a system artifact
4950
info Display information about the current system(s)

docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ COMMANDS:
4141
clean Delete various files produced during building
4242
create Create a new Common Lisp project
4343
dists List out all installed dists
44+
eval Evaluate lisp form with a proper PATH
4445
files Print all system files
4546
package Build a system artifact
4647
info Display information about the current system(s)

lisp/core/eval.lisp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
;;;; lisp/core/eval.lisp --- Evaluate lisp form with a proper PATH
2+
3+
;;; Commentary
4+
;;
5+
;; Command use to eval lisp form.
6+
;;
7+
;; $ qob eval [forms..]
8+
;;
9+
10+
;;; Code
11+
12+
(qob-start
13+
(let* ((name (qob-args 0)))
14+
(qob-info name)
15+
(if name
16+
(qob-eval name)
17+
(progn
18+
(qob-info "(No expression found)")
19+
(qob-help "core/eval")))))
20+
21+
;;; End of lisp/core/eval.lisp

qob-cli.asd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
(:file "cmds/core/clean")
2020
(:file "cmds/core/create")
2121
(:file "cmds/core/dists")
22+
(:file "cmds/core/eval")
2223
(:file "cmds/core/files")
2324
(:file "cmds/core/package")
2425
(:file "cmds/core/info")

0 commit comments

Comments
 (0)