[BusyBox-cvs] busybox/applets busybox.c,1.143,1.144
Tim Riker
timr at busybox.net
Fri Nov 7 19:37:23 UTC 2003
Update of /var/cvs/busybox/applets
In directory winder:/tmp/cvs-serv29266/applets
Modified Files:
busybox.c
Log Message:
wrap bb help output if CONFIG_FEATURE_AUTOWIDTH
Index: busybox.c
===================================================================
RCS file: /var/cvs/busybox/applets/busybox.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- busybox.c 4 Oct 2003 00:05:47 -0000 1.143
+++ busybox.c 7 Nov 2003 19:37:20 -0000 1.144
@@ -135,6 +135,14 @@
/* If we've already been here once, exit now */
if (been_there_done_that == 1 || argc < 1) {
const struct BB_applet *a = applets;
+ int output_width = 60;
+
+#ifdef CONFIG_FEATURE_AUTOWIDTH
+ /* Obtain the terminal width. */
+ get_terminal_width_height(0, &output_width, NULL);
+ /* leading tab and room to wrap */
+ output_width -= 20;
+#endif
fprintf(stderr, "%s\n\n"
"Usage: busybox [function] [arguments]...\n"
@@ -149,7 +157,7 @@
col +=
fprintf(stderr, "%s%s", ((col == 0) ? "\t" : ", "),
(a++)->name);
- if (col > 60 && a->name != 0) {
+ if (col > output_width && a->name != 0) {
fprintf(stderr, ",\n");
col = 0;
}
More information about the busybox-cvs
mailing list