wok-current annotate busybox/stuff/busybox-1.23-cmdline.u @ rev 17839
Add ijs
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Mon Mar 23 17:00:05 2015 -0400 (2015-03-23) |
parents | |
children |
rev | line source |
---|---|
pascal@17518 | 1 Display command line in usage output. Useful to debug scripts with variables. |
pascal@17518 | 2 --- busybox-1.23.0/libbb/appletlib.c |
pascal@17518 | 3 +++ busybox-1.23.0/libbb/appletlib.c |
pascal@17518 | 4 @@ -93,9 +93,16 @@ |
pascal@17518 | 5 |
pascal@17518 | 6 #endif /* FEATURE_COMPRESS_USAGE */ |
pascal@17518 | 7 |
pascal@17518 | 8 - |
pascal@17518 | 9 +static char **bb_argv; |
pascal@17518 | 10 void FAST_FUNC bb_show_usage(void) |
pascal@17518 | 11 { |
pascal@17518 | 12 + full_write2_str("\nCommand line: "); |
pascal@17518 | 13 + while (*bb_argv) { |
pascal@17518 | 14 + full_write2_str(*bb_argv++); |
pascal@17518 | 15 + full_write2_str(" "); |
pascal@17518 | 16 + } |
pascal@17518 | 17 + full_write2_str("\n\n"); |
pascal@17518 | 18 + |
pascal@17518 | 19 if (ENABLE_SHOW_USAGE) { |
pascal@17518 | 20 #ifdef SINGLE_APPLET_STR |
pascal@17518 | 21 /* Imagine that this applet is "true". Dont suck in printf! */ |
pascal@17518 | 22 @@ -615,6 +622,7 @@ |
pascal@17518 | 23 /* If we were called as "busybox..." */ |
pascal@17518 | 24 static int busybox_main(char **argv) |
pascal@17518 | 25 { |
pascal@17518 | 26 + bb_argv = argv; |
pascal@17518 | 27 if (!argv[1]) { |
pascal@17518 | 28 /* Called without arguments */ |
pascal@17518 | 29 const char *a; |
pascal@17518 | 30 @@ -792,6 +800,7 @@ |
pascal@17518 | 31 int main(int argc UNUSED_PARAM, char **argv) |
pascal@17518 | 32 #endif |
pascal@17518 | 33 { |
pascal@17518 | 34 + bb_argv = argv; |
pascal@17518 | 35 /* Tweak malloc for reduced memory consumption */ |
pascal@17518 | 36 #ifdef M_TRIM_THRESHOLD |
pascal@17518 | 37 /* M_TRIM_THRESHOLD is the maximum amount of freed top-most memory |