wok-current diff busybox/stuff/busybox-1.22-cmdline.u @ rev 16512
Add wiringpi-piglow (small utility writtrn in C to handle PiGlow leds)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Apr 24 21:18:26 2014 +0200 (2014-04-24) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.22-cmdline.u Thu Apr 24 21:18:26 2014 +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.21.1/libbb/appletlib.c 1.6 ++++ busybox-1.21.1/libbb/appletlib.c 1.7 +@@ -93,9 +93,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 +@@ -612,6 +619,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 +@@ -778,6 +786,7 @@ 1.34 + int main(int argc UNUSED_PARAM, char **argv) 1.35 + #endif 1.36 + { 1.37 ++ bb_argv = argv; 1.38 + /* Tweak malloc for reduced memory consumption */ 1.39 + #ifdef M_TRIM_THRESHOLD 1.40 + /* M_TRIM_THRESHOLD is the maximum amount of freed top-most memory