From e1cd65774760bc7d54ac78c7e6a55483a8e5569f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Wed, 3 Mar 2021 17:35:43 +0100 Subject: [PATCH] workaround to exit, when options are wrong --- bin/trashmail | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/trashmail b/bin/trashmail index 6eff679..b51e8db 100755 --- a/bin/trashmail +++ b/bin/trashmail @@ -40,9 +40,12 @@ show_help () { EOF } -set -- $(getopt -u -o dfhl:nwy --long force,hashed,help,not-hashed,hashlength:,whole-hash,symblols -- "$@" || exit 2) -echo getopt $? +# TODO: how exit main-shell from error in subshell??? +getopt -u -o dfhl:nwy --long force,hashed,help,not-hashed,hashlength:,whole-hash,symblols -- "$@" || exit $? +set -- $(getopt -u -o dfhl:nwy --long force,hashed,help,not-hashed,hashlength:,whole-hash,symblols -- "$@"|| exit $?) + +echo @: $@ while : ; do case $1 in -d)