Fix "toybox command --help".
This commit is contained in:
parent
690526a84f
commit
83d5d7a0bb
5
main.c
5
main.c
@ -114,8 +114,9 @@ static void unknown(char *name)
|
||||
// Parse --help and --version for (almost) all commands
|
||||
void check_help(char **arg)
|
||||
{
|
||||
if (!CFG_TOYBOX_HELP_DASHDASH || !*arg || (toys.which->flags&TOYFLAG_NOHELP))
|
||||
return;
|
||||
if (!CFG_TOYBOX_HELP_DASHDASH || !*arg) return;
|
||||
if (!CFG_TOYBOX || toys.which != toy_list)
|
||||
if (toys.which->flags&TOYFLAG_NOHELP) return;
|
||||
|
||||
if (!strcmp(*arg, "--help")) {
|
||||
if (CFG_TOYBOX && toys.which == toy_list && arg[1])
|
||||
|
@ -43,7 +43,8 @@ if isnewer "$GENDIR"/newtoys.h toys
|
||||
then
|
||||
echo -n "$GENDIR/newtoys.h "
|
||||
|
||||
echo "USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT))" > "$GENDIR"/newtoys.h
|
||||
echo "USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT|TOYFLAG_NOHELP))" \
|
||||
> "$GENDIR"/newtoys.h
|
||||
$SED -n -e 's/^USE_[A-Z0-9_]*(/&/p' toys/*/*.c \
|
||||
| $SED 's/\(.*TOY(\)\([^,]*\),\(.*\)/\2 \1\2,\3/' | sort -s -k 1,1 \
|
||||
| $SED 's/[^ ]* //' >> "$GENDIR"/newtoys.h
|
||||
|
Loading…
Reference in New Issue
Block a user