- format_string = "%s\n\nUsage: %s %s\n\n";
- if (*usage_string == '\b')
- format_string = "%s\n\nNo help available.\n\n";
- fprintf (stderr, format_string, bb_msg_full_version, applet_using->name,
- usage_string);
+ buf = xmalloc(SIZEOF_usage_messages);
+ full_read(output[0], buf, SIZEOF_usage_messages);
+ return buf;
+}
+
+#else
+#define unpack_usage_messages() usage_messages
+#endif /* ENABLE_FEATURE_COMPRESS_USAGE */
+
+void bb_show_usage (void)
+{
+ if (ENABLE_SHOW_USAGE) {
+ const char *format_string;
+ const char *usage_string = unpack_usage_messages();
+ int i;
+
+ for (i = applet_using - applets; i > 0;)
+ if (!*usage_string++) --i;
+
+ format_string = "%s\n\nUsage: %s %s\n\n";
+ if (*usage_string == '\b')
+ format_string = "%s\n\nNo help available.\n\n";
+ fprintf (stderr, format_string, bb_msg_full_version,
+ applet_using->name, usage_string);
+ }