From d412db9a1d958dc07a4f9324ec980db78dc42a49 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 2 Nov 2022 18:32:31 -0300 Subject: bin/cl: Add support for -E option --- bin/cl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/cl b/bin/cl index 48cc8af..87d7c92 100755 --- a/bin/cl +++ b/bin/cl @@ -53,6 +53,7 @@ help() { Options: -e EXP an sexp to be evaluated (can be given more than once) + -E EXP an sexp to be executed as a script -f FILE a file to be evaluated (can be given more than once) -p print the value of the last given expression -M IMAGE load the given Lisp image @@ -139,11 +140,16 @@ LISP_CLI_RC="${XDG_CONFIG_HOME:-$HOME/.config}/lisp-cli/init.lisp" VERBOSE=false IMAGE='' IMPL="${LISP_CLI_IMPL:-}" -while getopts 'e:f:pM:I:nvlh' flag; do +INTERACTIVE=true +while getopts 'e:E:f:pM:I:nvlh' flag; do case "$flag" in e) printf '%s\n' "$OPTARG" >> "$SCRIPT" ;; + E) + printf '%s\n' "$OPTARG" >> "$SCRIPT" + INTERACTIVE=false + ;; f) escape_name "$OPTARG" >> "$SCRIPT" ;; @@ -183,7 +189,6 @@ if [ "$1" != '--' ]; then fi PRESERVE_ARGS=false -INTERACTIVE=true for f in "$@"; do if [ "$f" = '--' ]; then PRESERVE_ARGS=true -- cgit v1.2.3