wok annotate busybox/stuff/busybox-1.28-cmdline.u @ rev 20205
Up busybox (1.18.1)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 20 18:10:43 2018 +0100 (2018-02-20) |
parents | |
children |
rev | line source |
---|---|
pascal@20205 | 1 Display command line in usage output. Useful to debug scripts with variables. |
pascal@20205 | 2 --- busybox-1.28/libbb/appletlib.c |
pascal@20205 | 3 +++ busybox-1.28/libbb/appletlib.c |
pascal@20205 | 4 @@ -127,9 +127,16 @@ |
pascal@20205 | 5 |
pascal@20205 | 6 #endif /* FEATURE_COMPRESS_USAGE */ |
pascal@20205 | 7 |
pascal@20205 | 8 - |
pascal@20205 | 9 +static char **bb_argv; |
pascal@20205 | 10 void FAST_FUNC bb_show_usage(void) |
pascal@20205 | 11 { |
pascal@20205 | 12 + full_write2_str("\nCommand line: "); |
pascal@20205 | 13 + while (*bb_argv) { |
pascal@20205 | 14 + full_write2_str(*bb_argv++); |
pascal@20205 | 15 + full_write2_str(" "); |
pascal@20205 | 16 + } |
pascal@20205 | 17 + full_write2_str("\n\n"); |
pascal@20205 | 18 + |
pascal@20205 | 19 if (ENABLE_SHOW_USAGE) { |
pascal@20205 | 20 #ifdef SINGLE_APPLET_STR |
pascal@20205 | 21 /* Imagine that this applet is "true". Dont suck in printf! */ |
pascal@20205 | 22 @@ -779,6 +786,7 @@ |
pascal@20205 | 23 # endif |
pascal@20205 | 24 int busybox_main(int argc UNUSED_PARAM, char **argv) |
pascal@20205 | 25 { |
pascal@20205 | 26 + bb_argv = argv; |
pascal@20205 | 27 if (!argv[1]) { |
pascal@20205 | 28 /* Called without arguments */ |
pascal@20205 | 29 const char *a; |
pascal@20205 | 30 @@ -976,6 +984,7 @@ |
pascal@20205 | 31 int main(int argc UNUSED_PARAM, char **argv) |
pascal@20205 | 32 #endif |
pascal@20205 | 33 { |
pascal@20205 | 34 + bb_argv = argv; |
pascal@20205 | 35 #if 0 |
pascal@20205 | 36 /* TODO: find a use for a block of memory between end of .bss |
pascal@20205 | 37 * and end of page. For example, I'm getting "_end:0x812e698 2408 bytes" |