wok-current annotate busybox/stuff/busybox-1.20-cmdline.u @ rev 13738
xbattle: add 24bits colors patch
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Dec 26 13:16:19 2012 +0100 (2012-12-26) |
parents | |
children |
rev | line source |
---|---|
pascal@12460 | 1 Display command line in usage output. Useful to debug scripts with variables. |
pascal@12460 | 2 --- busybox-1.20.1/libbb/appletlib.c |
pascal@12460 | 3 +++ busybox-1.20.1/libbb/appletlib.c |
pascal@12460 | 4 @@ -93,9 +93,16 @@ |
pascal@12460 | 5 |
pascal@12460 | 6 #endif /* FEATURE_COMPRESS_USAGE */ |
pascal@12460 | 7 |
pascal@12460 | 8 - |
pascal@12460 | 9 +static char **bb_argv; |
pascal@12460 | 10 void FAST_FUNC bb_show_usage(void) |
pascal@12460 | 11 { |
pascal@12460 | 12 + full_write2_str("\nCommand line: "); |
pascal@12460 | 13 + while (*bb_argv) { |
pascal@12460 | 14 + full_write2_str(*bb_argv++); |
pascal@12460 | 15 + full_write2_str(" "); |
pascal@12460 | 16 + } |
pascal@12460 | 17 + full_write2_str("\n\n"); |
pascal@12460 | 18 + |
pascal@12460 | 19 if (ENABLE_SHOW_USAGE) { |
pascal@12460 | 20 #ifdef SINGLE_APPLET_STR |
pascal@12460 | 21 /* Imagine that this applet is "true". Dont suck in printf! */ |
pascal@12460 | 22 @@ -611,6 +618,7 @@ |
pascal@12460 | 23 /* If we were called as "busybox..." */ |
pascal@12460 | 24 static int busybox_main(char **argv) |
pascal@12460 | 25 { |
pascal@12460 | 26 + bb_argv = argv; |
pascal@12460 | 27 if (!argv[1]) { |
pascal@12460 | 28 /* Called without arguments */ |
pascal@12460 | 29 const char *a; |
pascal@12460 | 30 @@ -774,6 +782,7 @@ |
pascal@12460 | 31 int main(int argc UNUSED_PARAM, char **argv) |
pascal@12460 | 32 #endif |
pascal@12460 | 33 { |
pascal@12460 | 34 + bb_argv = argv; |
pascal@12460 | 35 /* Tweak malloc for reduced memory consumption */ |
pascal@12460 | 36 #ifdef M_TRIM_THRESHOLD |
pascal@12460 | 37 /* M_TRIM_THRESHOLD is the maximum amount of freed top-most memory |