neverpanic / google-font-download

Locally host Google's web fonts
https://neverpanic.de/blog/2014/03/19/downloading-google-web-fonts-for-local-hosting/
BSD 2-Clause "Simplified" License
706 stars 72 forks source link

Help is not printed #5

Closed hydrapolic closed 9 years ago

hydrapolic commented 9 years ago

While trying to run the current master I get:

$ ./google-font-download ./google-font-download: Error: No font families given

fmt: cannot open '311' for reading: No such file or directory fmt: cannot open '319' for reading: No such file or directory

What exactly is the meaning of:

usage() { cols=$(tput cols) || cols=80 fmt $(( cols - 8 )) $cols >&2 <<-EOF

As I check the man page of fmt: SYNOPSIS fmt [-WIDTH] [OPTION]... [FILE]...

DESCRIPTION Reformat each paragraph in the FILE(s), writing to standard output. The option -WIDTH is an abbreviated form of --width=DIGITS.

Something like this works for me: fmt --width=$(( cols - 8 )) >&2 <<-EOF

I'm using Coreutils 8.24.

neverpanic commented 9 years ago

Great, so yet another incompatibility between a BSD and a GNU userland :/

It seem's both BSD's and GNU's fmt(1) support the -w option, so that's probably the way to go. GNU's version will then set the goal width automatically (yay), BSD's will not. The outcome will probably be that help output doesn't look as nice on OS X.

hydrapolic commented 9 years ago

Thanks, works fine.