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