wok-tiny view busybox/stuff/busybox-git-cmdline.u @ rev 176

busybox: fix modules order
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 14 19:16:39 2021 +0000 (2021-07-14)
parents
children
line source
1 Display command line in usage output. Useful to debug scripts with variables.
2 --- busybox-git/libbb/appletlib.c
3 +++ busybox-git/libbb/appletlib.c
4 @@ -128,9 +128,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 @@ -780,6 +787,7 @@
23 # endif
24 int busybox_main(int argc UNUSED_PARAM, char **argv)
25 {
26 + bb_argv = argv;
27 if (!argv[1]) {
28 /* Called without arguments */
29 const char *a;
30 @@ -977,6 +985,7 @@
31 int main(int argc UNUSED_PARAM, char **argv)
32 #endif
33 {
34 + bb_argv = argv;
35 #if 0
36 /* TODO: find a use for a block of memory between end of .bss
37 * and end of page. For example, I'm getting "_end:0x812e698 2408 bytes"