diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-22 13:22:26 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-22 13:22:26 +0200 |
commit | 62ae323df0856546754ecfe226fc9bf0dc16bcb8 (patch) | |
tree | 65f998cd15feb1ca4a5c65e13550d8ff7a1c72b1 /archival/tar.c | |
parent | 6c563e370d0f2f3cf36f3b274e8fe1392ca7125f (diff) | |
download | busybox-w32-62ae323df0856546754ecfe226fc9bf0dc16bcb8.tar.gz busybox-w32-62ae323df0856546754ecfe226fc9bf0dc16bcb8.tar.bz2 busybox-w32-62ae323df0856546754ecfe226fc9bf0dc16bcb8.zip |
tar: implement --version for buildroot
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/tar.c')
-rw-r--r-- | archival/tar.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/archival/tar.c b/archival/tar.c index 566ba34f6..23ac00e86 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -992,6 +992,15 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
992 | applet_long_options = tar_longopts; | 992 | applet_long_options = tar_longopts; |
993 | #endif | 993 | #endif |
994 | #if ENABLE_DESKTOP | 994 | #if ENABLE_DESKTOP |
995 | /* Lie to buildroot when it starts asking stupid questions. */ | ||
996 | if (argv[1] && strcmp(argv[1], "--version") == 0) { | ||
997 | // Output of 'tar --version' examples: | ||
998 | // tar (GNU tar) 1.15.1 | ||
999 | // tar (GNU tar) 1.25 | ||
1000 | // bsdtar 2.8.3 - libarchive 2.8.3 | ||
1001 | puts("tar (busybox) " BB_VER); | ||
1002 | return 0; | ||
1003 | } | ||
995 | if (argv[1] && argv[1][0] != '-') { | 1004 | if (argv[1] && argv[1][0] != '-') { |
996 | /* Compat: | 1005 | /* Compat: |
997 | * 1st argument without dash handles options with parameters | 1006 | * 1st argument without dash handles options with parameters |