aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-11-03 00:05:52 -0500
committerRob Landley <rob@landley.net>2006-11-03 00:05:52 -0500
commit0a04b3ef850cd3d6f06b3c8d0036993adc9ba7b2 (patch)
tree6833c64668f917b4f03c9c5317a4313937960ba4 /main.c
parent7fc43f79783658a38be23ca8b3cdac5f11e397d1 (diff)
downloadtoybox-0a04b3ef850cd3d6f06b3c8d0036993adc9ba7b2.tar.gz
Implement which. Add hello world to menuconfig. Wrap the various applet main
functions in main.c with USE() macros so --gc-sections can strip them.
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/main.c b/main.c
index de349ec6..00d76312 100644
--- a/main.c
+++ b/main.c
@@ -14,12 +14,13 @@ struct toy_list toy_list[] = {
// This one is out of order on purpose.
{"toybox", toybox_main, 0},
// The rest of these are alphabetical, for binary search.
- {"cd", cd_main, TOYFLAG_NOFORK},
- {"df", df_main, TOYFLAG_USR|TOYFLAG_SBIN},
- {"exit", exit_main, TOYFLAG_NOFORK},
- {"hello", hello_main, TOYFLAG_NOFORK|TOYFLAG_USR},
- {"sh", toysh_main, TOYFLAG_BIN},
- {"toysh", toysh_main, TOYFLAG_BIN}
+ USE_TOYSH({"cd", cd_main, TOYFLAG_NOFORK},)
+ USE_DF({"df", df_main, TOYFLAG_USR|TOYFLAG_SBIN},)
+ USE_TOYSH({"exit", exit_main, TOYFLAG_NOFORK},)
+ USE_HELLO({"hello", hello_main, TOYFLAG_NOFORK|TOYFLAG_USR},)
+ USE_TOYSH({"sh", toysh_main, TOYFLAG_BIN},)
+ USE_TOYSH({"toysh", toysh_main, TOYFLAG_BIN},)
+ USE_WHICH({"which", which_main, TOYFLAG_USR|TOYFLAG_BIN},)
};
#define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list))