wok annotate busybox/stuff/busybox-1.26-cmdline.u @ rev 19979

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