From 1f23b23775dfe2fcdedf7cb660cda521ed2f2285 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 20 Sep 2023 09:36:54 +0100 Subject: scripts: Allow script to be loaded without executing main. Call main from the shebang command instead of calling it directly. This allows us to run "guile -l scripts/ccwl" without actually running main. This seems to be important for Emacs Geiser as it freezes up without this fix. * scripts/ccwl: Call main from shebang. Do not call main directly. (main): Accept args as regular argument instead of as a rest argument. --- scripts/ccwl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/ccwl b/scripts/ccwl index 8e9d085..3001e5a 100755 --- a/scripts/ccwl +++ b/scripts/ccwl @@ -1,8 +1,8 @@ #!/usr/bin/env sh -exec guile --no-auto-compile -s "$0" "$@" +exec guile --no-auto-compile -e main -s "$0" "$@" !# ;;; ccwl --- Concise Common Workflow Language -;;; Copyright © 2021, 2022 Arun Isaac +;;; Copyright © 2021–2023 Arun Isaac ;;; ;;; This file is part of ccwl. ;;; @@ -47,7 +47,7 @@ exec guile --no-auto-compile -s "$0" "$@" (acons 'help #t result)))) (define main - (match-lambda* + (match-lambda ((program "compile" args ...) (let* ((args (args-fold args (list (option (list #\t "to") #t #f @@ -119,5 +119,3 @@ To get usage information for one of these sub-commands, run program program) (current-error-port)) (exit (assq 'help args)))))) - -(apply main (command-line)) -- cgit v1.2.3