Patch from Dennis Vlasenko to add the option to compress help text.
This commit is contained in:
parent
d5b9428bb6
commit
7e21d5f6b1
7 changed files with 101 additions and 23 deletions
14
scripts/usage.c
Normal file
14
scripts/usage.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include <unistd.h>
|
||||
#include "busybox.h"
|
||||
|
||||
static const char usage_messages[] =
|
||||
#define MAKE_USAGE
|
||||
#include "usage.h"
|
||||
#include "applets.h"
|
||||
;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
write(1, usage_messages, sizeof(usage_messages));
|
||||
return 0;
|
||||
}
|
11
scripts/usage_compressed
Normal file
11
scripts/usage_compressed
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
loc="$1"
|
||||
|
||||
test "$loc" || loc=.
|
||||
|
||||
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"/'
|
||||
echo ';'
|
||||
echo '#define SIZEOF_usage_messages' $((0 + `"$loc"/usage | wc -c `))
|
Loading…
Add table
Add a link
Reference in a new issue