Skip to content

Commit

Permalink
feat: add eval command
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 22, 2024
1 parent c68b6e3 commit 37fd014
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
32 changes: 32 additions & 0 deletions cmds/core/eval.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
;;;; cmds/core/eval.lisp --- Evaluate lisp form with a proper PATH

;;; Commentary
;;
;; The `eval' command definition.
;;

;;; Code

(defpackage qob-cli/eval
(:use cl)
(:export command))

(in-package :qob-cli/eval)

(defun options ()
"Options for `eval' command."
(list ))

(defun handler (cmd)
"Handler for `eval' command."
(qob-cli:call-script "core/eval" cmd))

(defun command ()
"The `eval' command."
(clingon:make-command
:name "eval"
:description "Evaluate lisp form with a proper PATH"
:options (options)
:handler #'handler))

;;; End of cmds/core/eval.lisp
1 change: 1 addition & 0 deletions cmds/qob.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
,(qob-cli/clean:command)
,(qob-cli/create:command)
,(qob-cli/dists:command)
,(qob-cli/eval:command)
,(qob-cli/files:command)
,(qob-cli/package:command)
,(qob-cli/info:command)
Expand Down
1 change: 1 addition & 0 deletions docs/content/Getting-Started/Basic-Usage/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ COMMANDS:
clean Delete various files produced during building
create Create a new Common Lisp project
dists List out all installed dists
eval Evaluate lisp form with a proper PATH
files Print all system files
package Build a system artifact
info Display information about the current system(s)
Expand Down
1 change: 1 addition & 0 deletions docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ COMMANDS:
clean Delete various files produced during building
create Create a new Common Lisp project
dists List out all installed dists
eval Evaluate lisp form with a proper PATH
files Print all system files
package Build a system artifact
info Display information about the current system(s)
Expand Down
21 changes: 21 additions & 0 deletions lisp/core/eval.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
;;;; lisp/core/eval.lisp --- Evaluate lisp form with a proper PATH

;;; Commentary
;;
;; Command use to eval lisp form.
;;
;; $ qob eval [forms..]
;;

;;; Code

(qob-start
(let* ((name (qob-args 0)))
(qob-info name)
(if name
(qob-eval name)
(progn
(qob-info "(No expression found)")
(qob-help "core/eval")))))

;;; End of lisp/core/eval.lisp
1 change: 1 addition & 0 deletions qob-cli.asd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
(:file "cmds/core/clean")
(:file "cmds/core/create")
(:file "cmds/core/dists")
(:file "cmds/core/eval")
(:file "cmds/core/files")
(:file "cmds/core/package")
(:file "cmds/core/info")
Expand Down

0 comments on commit 37fd014

Please sign in to comment.