From: Matt Kraai Date: Wed, 25 Oct 2000 19:05:38 +0000 (-0000) Subject: Restore --help handling I mistakenly removed. X-Git-Tag: 0_48~143 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2dab174daa01952147322197f7c1821217c5e7c5;p=platform%2Fupstream%2Fbusybox.git Restore --help handling I mistakenly removed. --- diff --git a/applets/busybox.c b/applets/busybox.c index 985798e..d356e4c 100644 --- a/applets/busybox.c +++ b/applets/busybox.c @@ -144,8 +144,11 @@ int main(int argc, char **argv) search_applet.name = applet_name; applet = bsearch(&search_applet, applets, NUM_APPLETS, 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)); + } return(busybox_main(argc, argv)); } diff --git a/busybox.c b/busybox.c index 985798e..d356e4c 100644 --- a/busybox.c +++ b/busybox.c @@ -144,8 +144,11 @@ int main(int argc, char **argv) search_applet.name = applet_name; applet = bsearch(&search_applet, applets, NUM_APPLETS, 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)); + } return(busybox_main(argc, argv)); }