From aded59184c42321bbd8cdeadbb8ec17734fa84da Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 5 Mar 2024 05:42:48 +0100 Subject: [PATCH] sometimes avoid unnecessary subshell in `ea` --- sh/ea | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sh/ea b/sh/ea index 0072c45..bd49c20 100755 --- a/sh/ea +++ b/sh/ea @@ -24,7 +24,7 @@ __ea_urlencode() { done } 2>&- # send bash's complaints to the abyss -ea() ( ### @- **TODO:** document. +__ea() { ### @ ea - **TODO:** document. cmd="${1:?missing subcommand}"; shift case "$cmd" in (head) @@ -74,6 +74,7 @@ ea() ( ### @- **TODO:** document. printf 'unknown subcommand: %s\n' "$cmd" >&2 return 2;; esac -) +} -[ -n "${preload+-}" ] || ea "$@" +ea()(__ea "$@") +[ -n "${preload+-}" ] || __ea "$@"