wok annotate busybox/stuff/busybox-1.21-cmdline.u @ rev 15390

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