Change 'function' style (#3364)

This commit is contained in:
Casper 2023-05-26 01:01:41 +02:00 committed by GitHub
parent cf74127f78
commit 37ca0f9ba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 233 additions and 466 deletions

View file

@ -3,8 +3,7 @@
# shellcheck source=../scripts/helpers/index.sh
source /usr/local/bin/helpers/index.sh
function _main
{
function _main() {
_require_n_parameters_or_print_usage 1 "${@}"
# Tests expect early exit without error if no DB exists:
@ -37,8 +36,7 @@ function _main
done
}
function __usage
{
function __usage() {
printf '%s' "${PURPLE}delmailuser${RED}(${YELLOW}8${RED})
${ORANGE}USAGE${RESET}
@ -71,8 +69,7 @@ ${ORANGE}EXIT STATUS${RESET}
"
}
function _parse_options
{
function _parse_options() {
while getopts ":yY" OPT
do
case "${OPT}" in
@ -89,8 +86,7 @@ function _parse_options
done
}
function _maildel_request_if_missing
{
function _maildel_request_if_missing() {
if [[ ${MAILDEL} -eq 0 ]]; then
local MAILDEL_CHOSEN
read -r -p "Do you want to delete the mailbox as well (removing all mails)? [Y/n] " MAILDEL_CHOSEN
@ -102,8 +98,7 @@ function _maildel_request_if_missing
fi
}
function _remove_maildir
{
function _remove_maildir() {
local MAIL_ACCOUNT=${1}
local LOCAL_PART="${MAIL_ACCOUNT%@*}"