From 9840fcdb428c712d21b057241e72ac9715ff6b28 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 3 Jan 2020 19:39:26 -0600 Subject: 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. --- toys/other/help.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'toys/other') 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; } -- cgit v1.2.3