aboutsummaryrefslogtreecommitdiff
path: root/scripts/usage_compressed
blob: 59e93e66911f7a5f89b347f517e6966a8699ffe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

loc="$1"

test "$loc" || loc=.
test -x "$loc/usage" || exit 1

echo 'static const char packed_usage[] = '
"$loc"/usage | bzip2 -9 | od -v -t x1 \
| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' || exit 1
echo ';'
sz=`"$loc"/usage | wc -c` || exit 1
echo '#define SIZEOF_usage_messages' `expr 0 + $sz`