aboutsummaryrefslogtreecommitdiff
path: root/toys/toylist.h
diff options
context:
space:
mode:
Diffstat (limited to 'toys/toylist.h')
-rw-r--r--toys/toylist.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/toys/toylist.h b/toys/toylist.h
index 87716b0f..a0eef1c1 100644
--- a/toys/toylist.h
+++ b/toys/toylist.h
@@ -10,15 +10,15 @@
#ifdef FROM_MAIN
#undef NEWTOY
#undef OLDTOY
-#define NEWTOY(name, flags) {#name, name##_main, flags},
-#define OLDTOY(name, oldname, flags) {#name, oldname##_main, flags},
+#define NEWTOY(name, opts, flags) {#name, name##_main, opts, flags},
+#define OLDTOY(name, oldname, opts, flags) {#name, oldname##_main, opts, flags},
// When #included from toys.h, provide function declarations and structs.
// The #else is because main.c #includes this file twice.
#else
-#define NEWTOY(name, flags) int name##_main(void);
-#define OLDTOY(name, oldname, flags)
+#define NEWTOY(name, opts, flags) int name##_main(void);
+#define OLDTOY(name, oldname, opts, flags)
struct df_data {
struct string_list *fstype;
@@ -39,6 +39,7 @@ union toy_union {
extern struct toy_list {
char *name;
int (*toy_main)(void);
+ char *options;
int flags;
} toy_list[];
@@ -48,15 +49,15 @@ extern struct toy_list {
// This one is out of order on purpose.
-NEWTOY(toybox, 0)
+NEWTOY(toybox, NULL, 0)
// The rest of these are alphabetical, for binary search.
-USE_TOYSH(NEWTOY(cd, TOYFLAG_NOFORK))
-USE_DF(NEWTOY(df, TOYFLAG_USR|TOYFLAG_SBIN))
-USE_TOYSH(NEWTOY(exit, TOYFLAG_NOFORK))
-USE_HELLO(NEWTOY(hello, TOYFLAG_NOFORK|TOYFLAG_USR))
-USE_PWD(NEWTOY(pwd, TOYFLAG_BIN))
-USE_TOYSH(OLDTOY(sh, toysh, TOYFLAG_BIN))
-USE_TOYSH(NEWTOY(toysh, TOYFLAG_BIN))
-USE_WHICH(NEWTOY(which, TOYFLAG_USR|TOYFLAG_BIN))
+USE_TOYSH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
+USE_DF(NEWTOY(df, "Pkt:a", TOYFLAG_USR|TOYFLAG_SBIN))
+USE_TOYSH(NEWTOY(exit, NULL, TOYFLAG_NOFORK))
+USE_HELLO(NEWTOY(hello, NULL, TOYFLAG_NOFORK|TOYFLAG_USR))
+USE_PWD(NEWTOY(pwd, NULL, TOYFLAG_BIN))
+USE_TOYSH(OLDTOY(sh, toysh, "c:i", TOYFLAG_BIN))
+USE_TOYSH(NEWTOY(toysh, "c:i", TOYFLAG_BIN))
+USE_WHICH(NEWTOY(which, "a", TOYFLAG_USR|TOYFLAG_BIN))