wok-6.x diff busybox/stuff/busybox-1.27-cmdline.u @ rev 22510
updated astromenace again (1.3.2 -> 1.4.1)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Jan 01 15:19:37 2020 +0100 (2020-01-01) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.27-cmdline.u Wed Jan 01 15:19:37 2020 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +Display command line in usage output. Useful to debug scripts with variables. 1.5 +--- busybox-1.27/libbb/appletlib.c 1.6 ++++ busybox-1.27/libbb/appletlib.c 1.7 +@@ -129,9 +129,16 @@ 1.8 + 1.9 + #endif /* FEATURE_COMPRESS_USAGE */ 1.10 + 1.11 +- 1.12 ++static char **bb_argv; 1.13 + void FAST_FUNC bb_show_usage(void) 1.14 + { 1.15 ++ full_write2_str("\nCommand line: "); 1.16 ++ while (*bb_argv) { 1.17 ++ full_write2_str(*bb_argv++); 1.18 ++ full_write2_str(" "); 1.19 ++ } 1.20 ++ full_write2_str("\n\n"); 1.21 ++ 1.22 + if (ENABLE_SHOW_USAGE) { 1.23 + #ifdef SINGLE_APPLET_STR 1.24 + /* Imagine that this applet is "true". Dont suck in printf! */ 1.25 +@@ -753,6 +760,7 @@ 1.26 + /* If we were called as "busybox..." */ 1.27 + static int busybox_main(char **argv) 1.28 + { 1.29 ++ bb_argv = argv; 1.30 + if (!argv[1]) { 1.31 + /* Called without arguments */ 1.32 + const char *a; 1.33 +@@ -952,6 +960,7 @@ 1.34 + int main(int argc UNUSED_PARAM, char **argv) 1.35 + #endif 1.36 + { 1.37 ++ bb_argv = argv; 1.38 + #if 0 1.39 + /* TODO: find a use for a block of memory between end of .bss 1.40 + * and end of page. For example, I'm getting "_end:0x812e698 2408 bytes"