Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/version/check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/version/check.sh')
-rw-r--r--src/lib/version/check.sh25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/lib/version/check.sh b/src/lib/version/check.sh
index fba2d1a..9bc29c1 100644
--- a/src/lib/version/check.sh
+++ b/src/lib/version/check.sh
@@ -29,7 +29,8 @@ pkgctl_version_check_usage() {
will be supplied from \${XDG_CONFIG_HOME}/nvchecker.
OPTIONS
- -h, --help Show this help text
+ -v, --verbose Display results including up-to-date versions
+ -h, --help Show this help text
EXAMPLES
$ ${COMMAND} neovim vim
@@ -37,9 +38,10 @@ _EOF_
}
pkgctl_version_check() {
- local path
local pkgbases=()
- local status_file path pkgbase upstream_version result
+ local verbose=0
+
+ local path status_file path pkgbase upstream_version result
local up_to_date=()
local out_of_date=()
@@ -53,6 +55,10 @@ pkgctl_version_check() {
pkgctl_version_check_usage
exit 0
;;
+ -v|--verbose)
+ verbose=1
+ shift
+ ;;
--)
shift
break
@@ -81,6 +87,11 @@ pkgctl_version_check() {
fi
fi
+ # enable verbose mode when we only have a single item to check
+ if (( ${#pkgbases[@]} == 1 )); then
+ verbose=1
+ fi
+
# start a terminal spinner as checking versions takes time
status_dir=$(mktemp --tmpdir="${WORKDIR}" --directory pkgctl-version-check-spinner.XXXXXXXXXX)
term_spinner_start "${status_dir}"
@@ -140,6 +151,14 @@ pkgctl_version_check() {
# stop the terminal spinner after all checks
term_spinner_stop "${status_dir}"
+ if (( verbose )) && (( ${#up_to_date[@]} > 0 )); then
+ printf "%sUp-to-date%s\n" "${section_separator}${BOLD}${UNDERLINE}" "${ALL_OFF}"
+ section_separator=$'\n'
+ for result in "${up_to_date[@]}"; do
+ msg_success " ${result}"
+ done
+ fi
+
if (( ${#failure[@]} > 0 )); then
printf "%sFailure%s\n" "${section_separator}${BOLD}${UNDERLINE}" "${ALL_OFF}"
section_separator=$'\n'