From 5af1b3e1c337fdf3de3017e22625adc2b6bc40d2 Mon Sep 17 00:00:00 2001 From: Rezart Qelibari Date: Mon, 25 Apr 2022 06:20:43 +0200 Subject: [PATCH] Add int and term trap calls --- modules/lib.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/lib.sh b/modules/lib.sh index f506326..6fe723a 100644 --- a/modules/lib.sh +++ b/modules/lib.sh @@ -80,10 +80,14 @@ function showQuestions() { function module_main() { local cmdName=${1:t} + local -A traps=() shift autoloadZShLib || return checkHelpPrerequisites || return configureLogging + trap 'traps call int; return 70' INT + trap 'traps call term; return 80' TERM + trap 'traps call exit' EXIT eval "`getUsage $cmdName | docopts -f -V - -h - : "$@"`" checkQuestionsPrerequisites || return [ "${show_questions}" = true ] && { showQuestions; return }