diff options
author | Arun Isaac | 2023-09-20 09:36:54 +0100 |
---|---|---|
committer | Arun Isaac | 2023-09-20 09:42:36 +0100 |
commit | 1f23b23775dfe2fcdedf7cb660cda521ed2f2285 (patch) | |
tree | 0f5df14ef3737acbdd424acd90b34849548adc73 | |
parent | d3e639f897aefb1c992e1864a9fc1aade31298d7 (diff) | |
download | ccwl-1f23b23775dfe2fcdedf7cb660cda521ed2f2285.tar.gz ccwl-1f23b23775dfe2fcdedf7cb660cda521ed2f2285.tar.lz ccwl-1f23b23775dfe2fcdedf7cb660cda521ed2f2285.zip |
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.
-rwxr-xr-x | scripts/ccwl | 8 |
1 files 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 <arunisaac@systemreboot.net> +;;; Copyright © 2021–2023 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; 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)) |