wok-next annotate busybox/stuff/busybox-1.22-cmdline.u @ rev 16567
Up: slitaz-boot-scripts + slitaz-tools (urgent bug fix)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu May 01 22:17:02 2014 +0200 (2014-05-01) |
parents | |
children |
rev | line source |
---|---|
pascal@15734 | 1 Display command line in usage output. Useful to debug scripts with variables. |
pascal@15734 | 2 --- busybox-1.21.1/libbb/appletlib.c |
pascal@15734 | 3 +++ busybox-1.21.1/libbb/appletlib.c |
pascal@15734 | 4 @@ -93,9 +93,16 @@ |
pascal@15734 | 5 |
pascal@15734 | 6 #endif /* FEATURE_COMPRESS_USAGE */ |
pascal@15734 | 7 |
pascal@15734 | 8 - |
pascal@15734 | 9 +static char **bb_argv; |
pascal@15734 | 10 void FAST_FUNC bb_show_usage(void) |
pascal@15734 | 11 { |
pascal@15734 | 12 + full_write2_str("\nCommand line: "); |
pascal@15734 | 13 + while (*bb_argv) { |
pascal@15734 | 14 + full_write2_str(*bb_argv++); |
pascal@15734 | 15 + full_write2_str(" "); |
pascal@15734 | 16 + } |
pascal@15734 | 17 + full_write2_str("\n\n"); |
pascal@15734 | 18 + |
pascal@15734 | 19 if (ENABLE_SHOW_USAGE) { |
pascal@15734 | 20 #ifdef SINGLE_APPLET_STR |
pascal@15734 | 21 /* Imagine that this applet is "true". Dont suck in printf! */ |
pascal@15734 | 22 @@ -612,6 +619,7 @@ |
pascal@15734 | 23 /* If we were called as "busybox..." */ |
pascal@15734 | 24 static int busybox_main(char **argv) |
pascal@15734 | 25 { |
pascal@15734 | 26 + bb_argv = argv; |
pascal@15734 | 27 if (!argv[1]) { |
pascal@15734 | 28 /* Called without arguments */ |
pascal@15734 | 29 const char *a; |
pascal@15734 | 30 @@ -778,6 +786,7 @@ |
pascal@15734 | 31 int main(int argc UNUSED_PARAM, char **argv) |
pascal@15734 | 32 #endif |
pascal@15734 | 33 { |
pascal@15734 | 34 + bb_argv = argv; |
pascal@15734 | 35 /* Tweak malloc for reduced memory consumption */ |
pascal@15734 | 36 #ifdef M_TRIM_THRESHOLD |
pascal@15734 | 37 /* M_TRIM_THRESHOLD is the maximum amount of freed top-most memory |