tools: keep the bank table aligned in a terminal

printf pads the cells, so the table lines up on the console and is
still a markdown table in the job summary.
This commit is contained in:
d00f committed 2026-10-29 20:47:31 +01:00
1 parent 49f2a156ee
commit a557e285a2
1 file changed
+3 -3
+3 -3
View File
@@ -26,13 +26,13 @@ web() {
print_line() {
local name=$1 main=$2 branch=$3
echo "| $name | $main | $branch | $((${branch:-0} - ${main:-0})) |"
printf '| %-15s | %7s | %7s | %7s |\n' "$name" "$main" "$branch" "$((${branch:-0} - ${main:-0}))"
}
echo "### $MACHINE"
echo
echo "| segment | main | branch | change |"
echo "| --- | ---: | ---: | ---: |"
printf '| %-15s | %7s | %7s | %7s |\n' "segment" "main" "branch" "change"
echo "| --------------- | ------: | ------: | ------: |"
for s in HOME CSEG BANK1 BANK2 BANK3 BANK4 DSEG XSEG; do
print_line "$s" "$(seg "$s" "$MAIN")" "$(seg "$s" "$BRANCH")"
done