wok diff busybox/stuff/busybox-1.26-cmdline.u @ rev 19981
Up gphoto2 (2.5.14), thanks Pasquale
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jun 18 19:23:12 2017 +0200 (2017-06-18) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.26-cmdline.u Sun Jun 18 19:23:12 2017 +0200 1.3 @@ -0,0 +1,37 @@ 1.4 +Display command line in usage output. Useful to debug scripts with variables. 1.5 +--- busybox-1.26/libbb/appletlib.c 1.6 ++++ busybox-1.26/libbb/appletlib.c 1.7 +@@ -92,9 +92,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 +@@ -714,6 +721,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 +@@ -916,6 +924,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"