From ecdc5b3ffabb58e3a9fc3a55a2a44323644995fc Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 6 May 2022 12:31:21 +0100 Subject: win32: allow preference for applets to be disabled at runtime The default busybox-w32 configuration enables the PREFER_APPLETS and SH_STANDALONE features. Sometimes it may be desirable to override the default preference for applets, for example, if an applet needs to be replaced by an external program with additional features. Add support for the environment variable BB_OVERRIDE_APPLETS. Its value may be: - a single dash ('-'): all applets are overridden; - a space-separated list of names: only the specified applets are overridden. --- shell/ash.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 6c1e58d6f..f42dc49c3 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -14961,10 +14961,12 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) { const char *a = applet_names; while (*a) { - col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '), a); - if (col > 60) { - out1fmt("\n"); - col = 0; + if (is_applet_preferred(a)) { + col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '), a); + if (col > 60) { + out1fmt("\n"); + col = 0; + } } while (*a++ != '\0') continue; -- cgit v1.2.3-55-g6feb