From 52d3b6ea3c47a84f58e06e0d09db5ce8f9cf383e Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 9 Dec 2018 07:37:22 +0100 Subject: [PATCH 2/2] Support -e, -x in geesh script. * scripts/geesh.in (options-spec): Support -e, -x. --- scripts/geesh.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/geesh.in b/scripts/geesh.in index fa8001f..e7a0051 100644 --- a/scripts/geesh.in +++ b/scripts/geesh.in @@ -24,17 +24,26 @@ (set! %load-compiled-path (cons "@GODIR@" %load-compiled-path)) (use-modules (geesh repl) + (geesh environment) (ice-9 getopt-long)) (define options-spec '((command (single-char #\c) (value #t)) - (stdin (single-char #\s)))) + (errexit (single-char #\e)) + (stdin (single-char #\s)) + (xtrace (single-char #\x)))) (let* ((options (getopt-long (program-arguments) options-spec #:stop-at-first-non-option #t)) (command (option-ref options 'command #f)) + (errexit? (option-ref options 'errexit #f)) (stdin (option-ref options 'stdin #f)) + (xtrace? (option-ref options 'xtrace #f)) (args (option-ref options '() '()))) + (when errexit? + (setopt! 'errexit #t)) + (when xtrace? + (setopt! 'xtrace #t)) (cond ((and command stdin) (format (current-error-port) -- 2.19.1