From 93881d86a1f660ffdb6c477f65acf99248dd8113 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 22 Apr 2022 16:47:01 +0530 Subject: bin: Add tissue repl subcommand. * bin/tissue (tissue-repl): New function. (print-usage): Print usage of tissue repl subcommand. (main): Call tissue-repl. --- bin/tissue | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bin/tissue b/bin/tissue index 555f114..566a6ea 100755 --- a/bin/tissue +++ b/bin/tissue @@ -357,6 +357,30 @@ Show the text of issue #ISSUE-NUMBER. "Load configuration and return object." (load (string-append (git-top-level) "/tissue.scm"))))) +(define tissue-repl + (match-lambda* + (("--help") + (format #t "Usage: ~a repl [-- FILE ARGS...] +In a tissue execution environment, run FILE as a Guile script with +command-line arguments ARGS. + +" + (command-line-program))) + (args + (let ((args (args-fold args + '() + invalid-option + (lambda (arg result) + (acons 'script arg result)) + '()))) + (match (reverse (filter-map (match-lambda + (('script . arg) arg) + (_ #f)) + args)) + ((script args ...) + (set-program-arguments (cons script args)) + (load (canonicalize-path script)))))))) + (define tissue-web (match-lambda* (("--help") @@ -383,6 +407,7 @@ COMMAND must be one of the sub-commands listed below: edit edit an issue show show the text of an issue news list recent updates + repl run a Guile script in a tissue environment web export repository as website To get usage information for one of these sub-commands, run @@ -410,6 +435,7 @@ To get usage information for one of these sub-commands, run ("list" tissue-list) ("edit" tissue-edit) ("show" tissue-show) + ("repl" tissue-repl) ("web" tissue-web) (invalid-command (format (current-error-port) "Invalid command `~a'~%~%" -- cgit v1.2.3