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