mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-11-01 18:04:12 +08:00
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:
1 parent
49f2a156ee
commit
a557e285a2
1 file changed
+3
-3
@@ -26,13 +26,13 @@ web() {
|
|||||||
|
|
||||||
print_line() {
|
print_line() {
|
||||||
local name=$1 main=$2 branch=$3
|
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 "### $MACHINE"
|
||||||
echo
|
echo
|
||||||
echo "| segment | main | branch | change |"
|
printf '| %-15s | %7s | %7s | %7s |\n' "segment" "main" "branch" "change"
|
||||||
echo "| --- | ---: | ---: | ---: |"
|
echo "| --------------- | ------: | ------: | ------: |"
|
||||||
for s in HOME CSEG BANK1 BANK2 BANK3 BANK4 DSEG XSEG; do
|
for s in HOME CSEG BANK1 BANK2 BANK3 BANK4 DSEG XSEG; do
|
||||||
print_line "$s" "$(seg "$s" "$MAIN")" "$(seg "$s" "$BRANCH")"
|
print_line "$s" "$(seg "$s" "$MAIN")" "$(seg "$s" "$BRANCH")"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in new issue
Block a user