Lines Matching full:argv
71 static void toy_singleinit(struct toy_list *which, char *argv[])
74 toys.argv = argv;
78 if (CFG_TOYBOX_HELP_DASHDASH && argv[1] && !strcmp(argv[1], "--help")) {
79 if (CFG_TOYBOX && toys.which == toy_list && toys.argv[2])
80 if (!(toys.which = toy_find(toys.argv[2]))) return;
87 toys.optargs = argv+1;
98 void toy_init(struct toy_list *which, char *argv[])
121 if (toys.optargs != toys.argv+1) free(toys.optargs);
126 toy_singleinit(which, argv);
131 void toy_exec(char *argv[])
137 if (!(which = toy_find(argv[0]))) return;
142 if (argv>=toys.optargs && argv<=toys.optargs+toys.optc) toys.optargs = 0;
145 toy_init(which, argv);
159 if (toys.argv[1]) {
161 toy_exec(toys.argv+1);
162 if (!strcmp("--version", toys.argv[1])) {
166 if (toys.argv[1][0] != '-') error_exit("Unknown command %s", toys.argv[1]);
173 if (toys.argv[1]) {
186 int main(int argc, char *argv[])
193 *argv = basename(*argv);
195 // Call the multiplexer, adjusting this argv[] to be its' argv[1].
197 toys.argv = argv-1;
201 toy_singleinit(toy_list, argv);