aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-02-14 21:46:30 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-02-14 21:46:30 +0000
commitd2023eab0195e6d7d0daea8f04d46af091d80965 (patch)
treeb46af8e1e7bcc057d3240490a6abc264c4ec82cd /utility.c
parente171a359ad2de7143fd6ad25bed00304af1094ec (diff)
downloadbusybox-w32-d2023eab0195e6d7d0daea8f04d46af091d80965.tar.gz
busybox-w32-d2023eab0195e6d7d0daea8f04d46af091d80965.tar.bz2
busybox-w32-d2023eab0195e6d7d0daea8f04d46af091d80965.zip
I forgot to add usage.h, so here it is, with a few extra cleanups.
Also update show_usage to handle the updated usage.h. Again, nearly all the work to get usage.h into shape was done by Manuel Novoa III. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1806 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--utility.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/utility.c b/utility.c
index 818523c38..89b601d04 100644
--- a/utility.c
+++ b/utility.c
@@ -84,11 +84,17 @@ extern void show_usage(void)
84 static const char no_help[] = "No help available.\n"; 84 static const char no_help[] = "No help available.\n";
85 85
86 const char *usage_string = no_help; 86 const char *usage_string = no_help;
87 int i;
87 88
88 if (applet_using->usage_index >= 0) { 89 if (applet_using->usage_index >= 0) {
89 usage_string = usage_messages[applet_using->usage_index]; 90 usage_string = usage_messages;
91 for (i=applet_using->usage_index ; i>0 ; ) {
92 if (!*usage_string++) {
93 --i;
94 }
95 }
90 } 96 }
91 fprintf(stderr, "%s\n\nUsage: %s %s\n", full_version, 97 fprintf(stderr, "%s\n\nUsage: %s %s\n\n", full_version,
92 applet_using->name, usage_string); 98 applet_using->name, usage_string);
93 exit(EXIT_FAILURE); 99 exit(EXIT_FAILURE);
94} 100}