mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-15 15:58:13 +01:00
rewritten list padding to be dynamic
This commit is contained in:
parent
35f77c0f89
commit
b8ea6d4d7f
1 changed files with 5 additions and 4 deletions
|
|
@ -342,12 +342,13 @@ dependency_check() {
|
|||
dependency_check "regctl" "regbin" "https://github.com/regclient/regclient/releases/latest/download/regctl-linux-TEMP"
|
||||
dependency_check "jq" "jqbin" "https://github.com/jqlang/jq/releases/latest/download/jq-linux-TEMP"
|
||||
|
||||
# Numbered List function
|
||||
# if urls.list exists add release note url per line
|
||||
# Numbered List function - pads with zero
|
||||
list_options() {
|
||||
num=1
|
||||
local total="${#Updates[@]}"
|
||||
[[ ${#total} < 2 ]] && local pads=2 || local pads="${#total}"
|
||||
local num=1
|
||||
for update in "${Updates[@]}"; do
|
||||
printf "%02d - %s\n" "$num" "$update"
|
||||
printf "%0*d - %s\n" $pads $num $update
|
||||
((num++))
|
||||
done
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue