aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Rob Landley <rob@landley.net>2006-04-27 23:34:46 +0000
committerGravatar Rob Landley <rob@landley.net>2006-04-27 23:34:46 +0000
commit7e21d5f6b1bdac9c20139e8bef82b17559e548a0 (patch)
tree08c1b12a37d2ef74b4471e154fe4227d3b6ae917 /scripts
parentd5b9428bb6e9d7524f6ef24868ce6394ade08255 (diff)
downloadbusybox-7e21d5f6b1bdac9c20139e8bef82b17559e548a0.tar.gz
busybox-7e21d5f6b1bdac9c20139e8bef82b17559e548a0.tar.bz2
Patch from Dennis Vlasenko to add the option to compress help text.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/usage.c14
-rw-r--r--scripts/usage_compressed11
2 files changed, 25 insertions, 0 deletions
diff --git a/scripts/usage.c b/scripts/usage.c
new file mode 100644
index 000000000..06f059acd
--- /dev/null
+++ b/scripts/usage.c
@@ -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;
+}
diff --git a/scripts/usage_compressed b/scripts/usage_compressed
new file mode 100644
index 000000000..fa12e4063
--- /dev/null
+++ b/scripts/usage_compressed
@@ -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 `))