diff options
| author | EuAndreh <eu@euandre.org> | 2022-10-20 11:07:19 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2022-10-20 11:07:20 -0300 |
| commit | 7c3a0a4f09c81558918b66deeafa486234a73294 (patch) | |
| tree | f7b0a320665021fd5c2d4b43026955dfeefc1ab1 /bin/cl | |
| parent | bin/cl: Handle -l option (diff) | |
| download | dotfiles-7c3a0a4f09c81558918b66deeafa486234a73294.tar.gz dotfiles-7c3a0a4f09c81558918b66deeafa486234a73294.tar.xz | |
Fix all ShellCheck warnings
IOW, `make check-shellcheck` passes.
Diffstat (limited to '')
| -rwxr-xr-x | bin/cl | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -187,6 +187,7 @@ for f in "$@"; do INTERACTIVE=false escape_name "$f" >> "$SCRIPT" done +set -- MAIN="$(mkstemp)" if [ "$NO_RC" = false ] && [ -e "$LISP_CLI_RC" ]; then @@ -217,7 +218,7 @@ if [ -z "$IMPL" ]; then fi done if [ -z "$IMPL" ]; then - printf 'Could not find any implementation in $PATH.\n' >&2 + printf "Could not find any implementation in \$PATH.\n" >&2 exit 2 fi fi @@ -228,6 +229,7 @@ if [ "$SKIP_DEFAULT_IMAGE" = false ] && [ -z "$IMAGE" ] && IMAGE="$DEFAULT_IMAGE" fi + case "$IMPL" in abcl) exit 4 @@ -242,19 +244,19 @@ case "$IMPL" in exit 4 ;; clisp) - ARGS="-ansi -i $MAIN" + set -- -ansi -i "$MAIN" if [ -n "$IMAGE" ]; then - set -- -M "$IMAGE" + set -- "$@" -M "$IMAGE" fi if [ "$NO_RC" = true ]; then - ARGS="$ARGS -norc" + set -- "$@" -norc fi if [ "$VERBOSE" = false ]; then - ARGS="$ARGS -q -q" + set -- "$@" -q -q else set -x fi - exec clisp $ARGS "$@" + exec clisp "$@" ;; cmucl) exit 4 @@ -269,19 +271,21 @@ case "$IMPL" in exit 4 ;; sbcl) - ARGS="--load $MAIN" + set -- --load "$MAIN" if [ -n "$IMAGE" ]; then - set -- --core "$IMAGE" + # The '--core' "C runtime option" must appear before the + # other "Lisp options", such as '--load'. + set -- --core "$IMAGE" "$@" fi if [ "$NO_RC" = true ]; then - ARGS="$ARGS --no-sysinit --no-userinit" + set -- "$@" --no-sysinit --no-userinit fi if [ "$VERBOSE" = false ]; then - ARGS="--noinform $ARGS" + set -- "$@" --noinform else set -x fi - exec sbcl "$@" $ARGS + exec sbcl "$@" ;; *) printf 'Unsupported implementation: "%s".\n\n' "$IMPL" >&2 |
