From 76d9e0a3bb88d60cdb8dd639a6761a60e0852c03 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 14 Sep 2024 03:39:52 -0300 Subject: [PATCH] Log when `portzap rm` completes successfully --- libexec/portzap/commands/portzap-rm | 31 ++++++++++++++++------------- share/portzap/CHANGELOG | 4 ++++ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/libexec/portzap/commands/portzap-rm b/libexec/portzap/commands/portzap-rm index a859348..18f179e 100755 --- a/libexec/portzap/commands/portzap-rm +++ b/libexec/portzap/commands/portzap-rm @@ -18,12 +18,12 @@ erase() dir="${1}" printf "%s " "${dir}" find "${dir}" \ - -maxdepth 1 \ - \! -name "." \ - \! -name ".." \ - \! -name "ports" \ - -exec printf . \; \ - -exec rm -rf "{}" \; + -maxdepth 1 \ + \! -name "." \ + \! -name ".." \ + \! -name "ports" \ + -exec printf . \; \ + -exec rm -rf "{}" \; echo } @@ -42,18 +42,21 @@ printf "1-4: " while true; do read -r r if [ "${r}" = "1" ]; then - erase "${repodir}" + erase "${repodir}" + printok "remove complete" elif [ "${r}" = "2" ]; then - erase "${installdir}" + erase "${installdir}" + printok "remove complete" elif [ "${r}" = "3" ]; then - erase "${repodir}" - erase "${installdir}" + erase "${repodir}" + erase "${installdir}" + printok "remove complete" elif [ "${r}" = "4" ]; then - break + break else - printf "%s is not a valid option\n" "${r}" - printf "1-4: " - continue + printf "%s is not a valid option\n" "${r}" + printf "1-4: " + continue fi exit done diff --git a/share/portzap/CHANGELOG b/share/portzap/CHANGELOG index def32c0..8ab4d48 100644 --- a/share/portzap/CHANGELOG +++ b/share/portzap/CHANGELOG @@ -2,6 +2,10 @@ * vNEXT +**** Log when ~portzap rm~ completes successfully +Similar to other commands, log when the ~portzap rm~ command +completes successfully + **** Format log messages with program name This change formats log messages written to standard output and standard error with the pattern ~portzap: ~