diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/lib/libremessages | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libremessages b/src/lib/libremessages index 78f9107..e7dd885 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -122,14 +122,14 @@ flag() { while [[ $indent -le ${#flag} ]]; do indent=$((indent+8)) done + local fmt2 fmt1 + fmt2=" %-${indent}s %s\n" + printf -v fmt1 " %-${indent}s %%s\n" '' local lines IFS=$'\n' lines=($(fmt -u -w $((72-indent)) <<<"$desc")) - local line - for line in "${lines[@]}"; do - printf " %-${indent}s %s\n" "$flag" "$line" - flag='' - done + printf -- "$fmt2" "$flag" "${lines[0]}" + [[ ${#lines[@]} -lt 2 ]] || printf -- "$fmt1" "${lines[@]:1}" } # Usage: term_title MESG [ARGS...] |