3 * help.c - Show help for toybox
5 * Copyright 2007 Rob Landley <rob@landley.net>
7 * Not in SUSv3, but exists as a bash builtin.
9 USE_HELP(NEWTOY(help, "<1", TOYFLAG_BIN))
17 Show usage information for toybox commands.
18 Run "toybox" with no arguments for a list of available commands.
23 #include "generated/help.h"
27 #define NEWTOY(name,opt,flags) help_##name "\0"
28 #define OLDTOY(name,oldname,opts,flags) "\xff" #oldname "\0"
29 static char *help_data =
30 #include "generated/newtoys.h"
35 struct toy_list *t = toy_find(*toys.optargs);
39 if (!t) error_exit("Unknown command '%s'", *toys.optargs);
41 while (i--) s += strlen(s) + 1;
43 i = toy_find(++s)-toy_list;
47 fprintf(toys.exithelp ? stderr : stdout, "%s", s);