From 910259e7c38e034899d617a98b302366e3539d4a Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Fri, 1 Nov 2024 11:34:28 +0100 Subject: [PATCH] new: [compose-core] add defaults and ``+`` sign in ``compose status`` fields spec for left/right align --- bin/compose-core | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index 9480843..872a73f 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -5681,17 +5681,22 @@ if [ "$action" == "status" ]; then state_columns_raw=() for col in "${state_columns[@]}"; do - if [[ "$col" == "-"* ]]; then - col=${col#-} + if [[ "$col" =~ ^[+-] ]]; then + col=${col:1} fi state_columns_raw+=("${col//-/_}") done state_columns_align="" for col in "${state_columns[@]}"; do if [[ "$col" == "-"* ]]; then + state_columns_align+="-" + elif [[ "$col" == "+"* ]]; then state_columns_align+="+" else - state_columns_align+="-" + case "${col//_/-}" in + version|upstream-version) state_columns_align+="+";; + *) state_columns_align+="-";; + esac fi done