diff --git a/lib/util.sh b/lib/util.sh index 86d3810..01ae88b 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -5,3 +5,8 @@ build_prompt() { printf '%s:%d> ' "$host" "$port" fi } + +cleanup() { + exec {sock}<&- + printf '\n' +} diff --git a/redish-cli b/redish-cli index 0803183..bd2de89 100755 --- a/redish-cli +++ b/redish-cli @@ -18,11 +18,17 @@ if (( $# )); then fi ### -# library +# load library ### . "${REDISH_LIB_PATH:-.}"/redi.sh +### +# cleanup on exit +### + +trap cleanup EXIT + ### # driver ###