fix: motd: improve command alignment in 41-commands script

- Simplify printf format string and fix invalid %-0s specifier
- Use underscore for intentionally unused sudo variable
- Add proper color formatting to commands
- Improve alignment of command output
This commit is contained in:
Igor Pecovnik 2026-01-26 19:50:40 +01:00 committed by Igor
parent 75ff6500e4
commit e2653ecb39

View File

@ -64,8 +64,8 @@ if [[ "${cmd_count}" -gt 0 ]]; then
echo ""
for l in "${output[@]}"
do
IFS=',' read -r name sudo command <<< "$l"
printf " \e[1;33m%-${name_len}s\e[0m %-0s: %s%s\n" "$name" "${sudo}" "${sudo}" "${command}"
IFS=',' read -r name _ command <<< "$l"
printf " \e[1;33m%-${name_len}s\e[0m: \e[0;92m%s\e[0m\n" "$name" "${command}"
done
echo -en "\033[0m"
fi