Restore --help handling I mistakenly removed.

This commit is contained in:
Matt Kraai 2000-10-25 19:05:38 +00:00
parent a0428eee9e
commit 2dab174daa
2 changed files with 8 additions and 2 deletions

View File

@ -144,8 +144,11 @@ int main(int argc, char **argv)
search_applet.name = applet_name; search_applet.name = applet_name;
applet = bsearch(&search_applet, applets, NUM_APPLETS, applet = bsearch(&search_applet, applets, NUM_APPLETS,
sizeof(struct BB_applet), applet_name_compare); sizeof(struct BB_applet), applet_name_compare);
if (applet != NULL) if (applet != NULL) {
if (applet->usage && argv[1] && strcmp(argv[1], "--help") == 0)
usage(applet->usage);
exit((*(applet->main)) (argc, argv)); exit((*(applet->main)) (argc, argv));
}
return(busybox_main(argc, argv)); return(busybox_main(argc, argv));
} }

View File

@ -144,8 +144,11 @@ int main(int argc, char **argv)
search_applet.name = applet_name; search_applet.name = applet_name;
applet = bsearch(&search_applet, applets, NUM_APPLETS, applet = bsearch(&search_applet, applets, NUM_APPLETS,
sizeof(struct BB_applet), applet_name_compare); sizeof(struct BB_applet), applet_name_compare);
if (applet != NULL) if (applet != NULL) {
if (applet->usage && argv[1] && strcmp(argv[1], "--help") == 0)
usage(applet->usage);
exit((*(applet->main)) (argc, argv)); exit((*(applet->main)) (argc, argv));
}
return(busybox_main(argc, argv)); return(busybox_main(argc, argv));
} }