From 5bb44a69264864ac8c539ba799acc7c8f90f8945 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@Kateryna)" Date: Wed, 19 Mar 2025 22:52:17 -0400 Subject: [PATCH] Added tab-completion to checkver --- _bin/checkver.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/_bin/checkver.sh b/_bin/checkver.sh index c67458b..f41589f 100755 --- a/_bin/checkver.sh +++ b/_bin/checkver.sh @@ -2,6 +2,8 @@ SCRIPT_DIR=${SCRIPT_DIR:-"$( cd -- "$( dirname -- "$0" )" &> /dev/null && pwd )"} set -e +BASE_NAME="${0##*/}" +SCRIPT_NAME="${SCRIPT_DIR}/${BASE_NAME}" # Function to compare semantic versions compare_major_version() { @@ -20,7 +22,7 @@ if [[ "${1}" =~ ^(-h|--help$) ]]; then "Query runtipi's current version and compares with what is available online" \ "" \ "Usage:" \ - " ${0##*/} -h | --help | [next] [] " \ + " ${BASE_NAME} -h | --help | [next] [] " \ "" \ "Arguments:" \ " -h | --help Display usage" \ @@ -36,7 +38,51 @@ if [[ "${1}" =~ ^(-h|--help$) ]]; then " major versions do not match" exit 1 fi - + +# --- tab completion --- +completion_bash() { +cat < /dev/null && pwd )"} current_version="$1" @@ -97,3 +143,4 @@ elif [ "$next_tag" != "$current_version" ]; then compare_major_version "$next_tag" "$current_version" fi +# vim: set ft=sh expandtab tabstop=4 shiftwidth=4: \ No newline at end of file