diff options
author | Rob Landley <rob@landley.net> | 2020-01-03 19:39:26 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-01-03 19:39:26 -0600 |
commit | 9840fcdb428c712d21b057241e72ac9715ff6b28 (patch) | |
tree | 101250bae8b418757a2ccf2b0b3382927999b619 /toys/other | |
parent | 440328edfcf65f29b69f9069517b7192e026c187 (diff) | |
download | toybox-9840fcdb428c712d21b057241e72ac9715ff6b28.tar.gz |
Finish cd, make help -ahu unconditional, fix expand memory cleanup path,
set $HOME $PWD and $OLDPWD, fix prompt \w, shuffle some functions around
to avoid prototypes, implement tilde expansion, add FORCE_COPY.
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/help.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/toys/other/help.c b/toys/other/help.c index 3ac4f128..686f862b 100644 --- a/toys/other/help.c +++ b/toys/other/help.c @@ -4,29 +4,21 @@ * * Often a shell builtin. -USE_HELP(NEWTOY(help, ""USE_HELP_EXTRAS("ahu"), TOYFLAG_BIN|TOYFLAG_MAYFORK)) +USE_HELP(NEWTOY(help, "ahu", TOYFLAG_BIN|TOYFLAG_MAYFORK)) config HELP bool "help" default y depends on TOYBOX_HELP help - usage: help [command] - - Show usage information for toybox commands. - Run "toybox" with no arguments for a list of available commands. - -config HELP_EXTRAS - bool "help -ah" - default y - depends on TOYBOX - depends on HELP - help - usage: help [-ah] [COMMAND] + usage: help [-ahu] [COMMAND] -a All commands -u Usage only -h HTML output + + Show usage information for toybox commands. + Run "toybox" with no arguments for a list of available commands. */ #define FOR_help @@ -51,11 +43,11 @@ void help_main(void) int i; // If called with no arguments as a builtin form the shell, show all builtins - if (!*toys.optargs && toys.rebound) { + if (toys.rebound && !*toys.optargs && !toys.optflags) { for (i = 0; i < toys.toycount; i++) { if (!(toy_list[i].flags&(TOYFLAG_NOFORK|TOYFLAG_MAYFORK))) continue; toys.which = toy_list+i; - show_help(stdout, 0); + show_help(stdout, FLAG(u)); } return; } |