Browse Source

new: [compose-core] add defaults and ``+`` sign in ``compose status`` fields spec for left/right align

fix-host-charm-resources
Valentin Lab 2 months ago
parent
commit
910259e7c3
  1. 11
      bin/compose-core

11
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

Loading…
Cancel
Save