From b841cd2f8c1b378c1e8d73f5915662b8e79aac80 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 1 Jun 2007 13:41:24 -0400 Subject: Allow applets with optarg string NULL to use toy.optargs[]. --- main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 56d6eb37..3a50f395 100644 --- a/main.c +++ b/main.c @@ -58,18 +58,19 @@ void toy_init(struct toy_list *which, char *argv[]) toys.argv = argv; toys.exitval = 1; if (which->options) get_optflags(); + else toys.optargs = argv+1; } // Run a toy. void toy_exec(char *argv[]) { struct toy_list *which; - + which = toy_find(argv[0]); if (!which) return; toy_init(which, argv); - + exit(toys.which->toy_main()); } -- cgit v1.2.3