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
This commit is contained in:
parent
67991cf824
commit
3ec8ffb121
2038
applets/usage.h
Normal file
2038
applets/usage.h
Normal file
File diff suppressed because it is too large
Load Diff
2038
include/usage.h
Normal file
2038
include/usage.h
Normal file
File diff suppressed because it is too large
Load Diff
10
utility.c
10
utility.c
@ -84,11 +84,17 @@ extern void show_usage(void)
|
|||||||
static const char no_help[] = "No help available.\n";
|
static const char no_help[] = "No help available.\n";
|
||||||
|
|
||||||
const char *usage_string = no_help;
|
const char *usage_string = no_help;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (applet_using->usage_index >= 0) {
|
if (applet_using->usage_index >= 0) {
|
||||||
usage_string = usage_messages[applet_using->usage_index];
|
usage_string = usage_messages;
|
||||||
|
for (i=applet_using->usage_index ; i>0 ; ) {
|
||||||
|
if (!*usage_string++) {
|
||||||
|
--i;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%s\n\nUsage: %s %s\n", full_version,
|
fprintf(stderr, "%s\n\nUsage: %s %s\n\n", full_version,
|
||||||
applet_using->name, usage_string);
|
applet_using->name, usage_string);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user