diff --git a/helpers/logging.sh b/helpers/logging.sh index 22ef1a2..afde1b7 100644 --- a/helpers/logging.sh +++ b/helpers/logging.sh @@ -17,13 +17,13 @@ logging_debug() { fi } -function logging_warn() { +logging_warn() { if [ "${ELL_LOG_LEVEL}" -ge 4 ]; then echo "${LOG_STYLE_PUNC}[${LOG_STYLE_RESET}$(date +'%Y-%m-%d %H:%M:%S')${LOG_STYLE_PUNC}]${LOG_STYLE_RESET} $(basename "${0}") ${LOG_STYLE_WARN}WARN${LOG_STYLE_RESET} ${*}" >&2; fi } -function logging_info() { +logging_info() { if [ "${ELL_LOG_LEVEL}" -ge 4 ]; then printf "%s" "${LOG_STYLE_PUNC}[${LOG_STYLE_RESET}$(date +'%Y-%m-%d %H:%M:%S')${LOG_STYLE_PUNC}]${LOG_STYLE_RESET} $(basename "${0}") " >&2; fi @@ -32,7 +32,7 @@ function logging_info() { fi } -function logging_error() { +logging_error() { if [ "${ELL_LOG_LEVEL}" -ge 4 ]; then printf "%s" "${LOG_STYLE_PUNC}[${LOG_STYLE_RESET}$(date +'%Y-%m-%d %H:%M:%S')${LOG_STYLE_PUNC}]${LOG_STYLE_RESET} $(basename "${0}") " >&2; fi @@ -41,7 +41,7 @@ function logging_error() { fi } -function logging_fatal() { +logging_fatal() { if [ "${ELL_LOG_LEVEL}" -ge 4 ]; then printf "%s" "${LOG_STYLE_PUNC}[${LOG_STYLE_RESET}$(date +'%Y-%m-%d %H:%M:%S')${LOG_STYLE_PUNC}]${LOG_STYLE_RESET} $(basename "${0}") " >&2; fi @@ -50,4 +50,4 @@ function logging_fatal() { fi } -export -f logging_debug logging_info logging_warn logging_error logging_fatal; \ No newline at end of file +export logging_debug logging_info logging_warn logging_error logging_fatal; \ No newline at end of file diff --git a/helpers/parse_arguments.sh b/helpers/parse_arguments.sh index 4ba9699..e01d868 100644 --- a/helpers/parse_arguments.sh +++ b/helpers/parse_arguments.sh @@ -26,7 +26,7 @@ print_version() { echo "${0} $ELL_VERSION https://github.com/simonmysun/ell"; } -function parse_arguments() { +parse_arguments() { if [ ${#} -eq 0 ]; then if [ "x${ELL_RECORD}" = "xtrue" ]; then logging_debug "Record mode enabled. Context is used."; diff --git a/helpers/piping.sh b/helpers/piping.sh index ed9c6ef..11ae469 100755 --- a/helpers/piping.sh +++ b/helpers/piping.sh @@ -15,4 +15,4 @@ piping() { fi } -export -f piping; \ No newline at end of file +export piping; \ No newline at end of file diff --git a/llm_backends/ell_echo/generate_completion.sh b/llm_backends/ell_echo/generate_completion.sh index dc2a771..be2f372 100644 --- a/llm_backends/ell_echo/generate_completion.sh +++ b/llm_backends/ell_echo/generate_completion.sh @@ -2,8 +2,8 @@ # This is a dummy function that echoes the input. Designed for debugging and testing purposes. -function generate_completion() { +generate_completion() { cat -; } -export -f generate_completion; \ No newline at end of file +export generate_completion; \ No newline at end of file diff --git a/llm_backends/gemini/generate_completion.sh b/llm_backends/gemini/generate_completion.sh index 588cf91..b6363c5 100644 --- a/llm_backends/gemini/generate_completion.sh +++ b/llm_backends/gemini/generate_completion.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -function generate_completion() { +generate_completion() { if [ "x${ELL_API_STREAM}" != "xtrue" ]; then logging_debug "Streaming disabled"; response=$(cat - | curl "${ELL_API_URL}${ELL_LLM_MODEL}:generateContent" \ @@ -93,4 +93,4 @@ function generate_completion() { fi } -export -f generate_completion; \ No newline at end of file +export generate_completion; \ No newline at end of file diff --git a/llm_backends/openai/generate_completion.sh b/llm_backends/openai/generate_completion.sh index 59dec22..7e38927 100644 --- a/llm_backends/openai/generate_completion.sh +++ b/llm_backends/openai/generate_completion.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -function generate_completion() { +generate_completion() { if [ "x${ELL_API_STREAM}" != "xtrue" ]; then logging_debug "Streaming disabled"; response=$(cat - | curl "${ELL_API_URL}" \ @@ -81,4 +81,4 @@ function generate_completion() { fi } -export -f generate_completion; \ No newline at end of file +export generate_completion; \ No newline at end of file diff --git a/plugins/syntax_highlight/50_post_llm.sh b/plugins/syntax_highlight/50_post_llm.sh index b651b89..6069423 100755 --- a/plugins/syntax_highlight/50_post_llm.sh +++ b/plugins/syntax_highlight/50_post_llm.sh @@ -40,7 +40,7 @@ if [ "x${TO_TTY}" = "xtrue" ]; then CURRENT_LINE=""; - function current_style() { + current_style() { # Set the style based on the current state of the syntax highlighting. printf "%b" "${STYLE_RESET}"; if [ "x${IN_LINK_TEXT}" = "xtrue" ]; then diff --git a/tests/piping.sh b/tests/piping.sh index 21df753..d896512 100644 --- a/tests/piping.sh +++ b/tests/piping.sh @@ -2,13 +2,13 @@ set -o posix; -function inc() { +inc() { while read -r -N 1 char; do printf '%s' $(( (char + 1) % 10 )); done } -export -f inc; +export -f inc; # why -f is necessary? . "$(dirname "${0}")/../helpers/piping.sh";