Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ciel feature to ciel-script #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Finally, we write a handler function, that reads the arguments and does somethin
Now, run everything:

~~~lisp
#+ciel
#+ciel-script
(clingon:run *cli/command* *script-args*)
~~~

Expand Down Expand Up @@ -277,15 +277,15 @@ How it works:

## Main function and interactive development

TLDR: use the `#+ciel` feature flag as in:
TLDR: use the `#+ciel-script` feature flag as in:

~~~lisp
(in-package :ciel-user)

(defun main ()
…)

#+ciel
#+ciel-script
(main)
~~~

Expand Down Expand Up @@ -320,7 +320,7 @@ list. The `#+foo` reader macro is the way to check if the feature
always disable a piece of code, the pattern is `#+(or)`, that always
evaluates to nil.

Make sure you are "in" the `ciel-user` package when writing this `#+ciel` check.
Make sure you are "in" the `ciel-user` package when writing this `#+ciel-script` check.


## Eval and one-liners
Expand Down Expand Up @@ -496,7 +496,7 @@ This creates one route on `/` with an optional `name` parameter. Go to `localhos
(defun stop-webapp ()
(hunchentoot:stop *server*))

#+ciel
#+ciel-script
(progn
(start-webapp)
(format t "~&App started on localhost:4567…~&")
Expand Down Expand Up @@ -533,7 +533,7 @@ This allows you to have a dumb "live reload" workflow with a simple editor and a
;; Catch some READ errors, such as parenthesis not closed, etc.
(format! t "~%~%read error, waiting for change…~&"))))))

#+ciel
#+ciel-script
(unless *server*
(start-webapp)
(format t "~&App started on localhost:4567…~&")
Expand Down
4 changes: 2 additions & 2 deletions scripting.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(t
;; Run it!
;; We first add a symbol in the feature list, so a script nows when it is being executed.
(push :ciel ciel-user::*features*)
(push :ciel-script ciel-user::*features*)
;; We ignore the shebang line, if there is one.
;; We can call scripts either with ciel -s <name> or with ./script
(load (maybe-ignore-shebang
Expand Down Expand Up @@ -226,7 +226,7 @@
((and (first args)
(uiop:file-exists-p (first args)))
;; Add a symbol in the feature list, so a script knows when it is being executed.
(push :ciel ciel-user::*features*)
(push :ciel-script ciel-user::*features*)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the :ciel-script right? Not :ciel


;; The remaining free args are passed along to our script's arguments.
;; Here the file name is already a free arg, so args equals something like
Expand Down
2 changes: 1 addition & 1 deletion src/ciel.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ We currently only try this with serapeum. See *deps/serapeum/sequences-hashtable
(defparameter *current-pprint-indentation* 1
"We use custom indentation instead of the pretty printer, because it doesn't print correctly in the shell (indentations are way too large).")

;; TEST
;TEST
(defun pretty-print-hash-table (ht &optional (stream *standard-output*))
"Pretty print hash-table HT to STREAM.

Expand Down
4 changes: 2 additions & 2 deletions src/scripts/apipointer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

;; Feature flag:
;; call our main function only when running the script, not when developing on the REPL.
#+ciel
#+ciel-script
(main (second uiop:*command-line-arguments*) (third uiop:*command-line-arguments*))
#-ciel
#-ciel-script
(format t "Usage: (main url pointer)~&")
2 changes: 1 addition & 1 deletion src/scripts/finder.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
list)
(terpri))

#+ciel
#+ciel-script
(pprint-for-shell (find-files (rest *script-args*)))
2 changes: 1 addition & 1 deletion src/scripts/quicksearch.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

;; We use a "feature flag" kind of like a "file == __main__" check:
;; don't run this when developing on the REPL, but yes run it when calling it with CIEL.
#+ciel
#+ciel-script
(quicksearch:? (second uiop:*command-line-arguments*) :ud) ;; url and details.
2 changes: 1 addition & 1 deletion src/scripts/simpleHTTPserver.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,5 @@ the script name.

;; Call the main function only when running this as a script,
;; not when developing on the REPL.
#+ciel
#+ciel-script
(clingon:run (cli/command) *script-args*)
2 changes: 1 addition & 1 deletion src/scripts/webapp-notify.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(format! t "~%~%read error, waiting for change…~&"))))))


#+ciel
#+ciel-script
(unless *server*
(start-webapp)
(format t "~&App started on localhost:4567…~&")
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/webapp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(defun stop-webapp ()
(hunchentoot:stop *server*))

#+ciel
#+ciel-script
(progn
(start-webapp)
(format t "~&App started on localhost:4567…~&")
Expand Down