summaryrefslogtreecommitdiff
path: root/src/lib/libremessages
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libremessages')
-rwxr-xr-xsrc/lib/libremessages22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/libremessages b/src/lib/libremessages
index e7dd885..943aca3 100755
--- a/src/lib/libremessages
+++ b/src/lib/libremessages
@@ -113,21 +113,21 @@ flag() {
# this should be increased in increments of 8 (that is, a
# literal-tab). Everything should be wrapped to 75 columns.
- # The printf-format we use has 3 spaces built into it (two at
- # the beginning, and a seperator). Therefore, the default
- # indent is 16-3=13 columns. And the width left for $desc
- # is (75-3)-indent = 72-indent.
-
- declare -i indent=13
- while [[ $indent -le ${#flag} ]]; do
- indent=$((indent+8))
+ # The printf-format we use has 4 spaces built into it (two at
+ # the beginning, and two for a seperator). Therefore, the
+ # default indent is 16-4=12 columns. And the width left for
+ # $desc is (75-4)-indent = 71-indent.
+
+ declare -i indent=12
+ while [[ $indent -lt $flaglen ]]; do
+ indent+=8
done
local fmt2 fmt1
- fmt2=" %-${indent}s %s\n"
- printf -v fmt1 " %-${indent}s %%s\n" ''
+ fmt2=" %-${indent}s %s\n"
+ printf -v fmt1 " %-${indent}s %%s\n" ''
local lines
- IFS=$'\n' lines=($(fmt -u -w $((72-indent)) <<<"$desc"))
+ IFS=$'\n' lines=($(fmt -u -w $((71-indent)) <<<"$desc"))
printf -- "$fmt2" "$flag" "${lines[0]}"
[[ ${#lines[@]} -lt 2 ]] || printf -- "$fmt1" "${lines[@]:1}"
}