Skip to content

Commit aefada8

Browse files
committed
Fix --help output with GNU fmt(1)
BSD fmt accepts two numeric parameters defining goal with and maximum width. GNU's version, however, would interpret these numeric options as files. Both GNU and BSD fmt(1) support the -w option to specify the maximum width. GNU's version automatically sets the goal width based on that value, but BSD fmt does not support setting the goal width in any other way and does not automatically determine it either. We'll have to live with the slightly less beautiful output on OS X and BSD, then. Closes #5
1 parent 081b777 commit aefada8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

google-font-download

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ url="http://fonts.googleapis.com/css"
5151
# Usage message
5252
usage() {
5353
cols=$(tput cols) || cols=80
54-
fmt $(( cols - 8 )) $cols >&2 <<-EOF
54+
fmt -w $(( cols - 8 )) >&2 <<-EOF
5555
USAGE
5656
${0:-google-font-download} [OPTION...] [FONT...]
5757
@@ -136,7 +136,7 @@ if [ $modern_getopt -eq 1 ]; then
136136
fi
137137
else
138138
cols=$(tput cols) || cols=80
139-
fmt $(( cols - 8 )) $cols >&2 <<-EOF
139+
fmt -w $(( cols - 8 )) >&2 <<-EOF
140140
Warning: Old getopt(1) detected.
141141
142142
Your version of getopt(1) does not correctly deal with whitespace and does not support long options. You may

0 commit comments

Comments
 (0)