[BusyBox] tar usage message

Rainer Weikusat rainer.weikusat at sncag.com
Sun Aug 21 13:33:04 MDT 2005


The usage string of the busybox tar program has the following
three issues:

	1) It always contains the 'Archive format selection'-headline,
           although support for the corresponding options has not been
           compiled into the binary.

	2) It does not contain information about the optional -T and
           -X switches.

	3) There is some infrastructure to document an "exclude"
           options, which is not implemented in tar.c

The patch below changes these three.

--- busybox/include/usage.h	26 Jul 2005 15:52:07 -0000	1.14
+++ busybox/include/usage.h	21 Aug 2005 19:11:56 -0000	1.15
@@ -2685,11 +2685,6 @@
 #else
 #  define USAGE_TAR_CREATE(a)
 #endif
-#ifdef CONFIG_FEATURE_TAR_EXCLUDE
-#  define USAGE_TAR_EXCLUDE(a) a
-#else
-#  define USAGE_TAR_EXCLUDE(a)
-#endif
 #ifdef CONFIG_FEATURE_TAR_GZIP
 #  define USAGE_TAR_GZIP(a) a
 #else
@@ -2705,28 +2700,39 @@
 #else
 #  define USAGE_TAR_COMPRESS(a)
 #endif
+#ifdef CONFIG_FEATURE_TAR_FROM
+#  define USAGE_TAR_FROM(a) a
+#else
+#  define USAGE_TAR_FROM(a)
+#endif
+
+#if defined(CONFIG_FEATURE_TAR_GZIP) || defined(CONFIG_FEATURE_TAR_BZIP2) || defined(CONFIG_FEATURE_TAR_COMPRESS)
+#  define USAGE_TAR_ARCHIVE_FORMAT(a) a
+#else
+#  define USAGE_TAR_ARCHIVE_FORMAT(a)
+#endif
 
 #define tar_trivial_usage \
 	"-[" USAGE_TAR_CREATE("c") USAGE_TAR_GZIP("z") USAGE_TAR_BZIP2("j") USAGE_TAR_COMPRESS("Z") "xtvO] " \
-	USAGE_TAR_EXCLUDE("[-X FILE]") \
-	"[-f TARFILE] [-C DIR] [FILE(s)] ..."
+	"[-f TARFILE] [-C DIR] [FILE(s)]" \
+	USAGE_TAR_FROM("[-T FILE] [-X FILE] [-i]") " ..."
 #define tar_full_usage \
 	"Create, extract, or list files from a tar file.\n\n" \
 	"Options:\n" \
 	USAGE_TAR_CREATE("\tc\t\tcreate\n") \
 	"\tx\t\textract\n" \
 	"\tt\t\tlist\n" \
-	"\nArchive format selection:\n" \
+	USAGE_TAR_ARCHIVE_FORMAT("\nArchive format selection:\n") \
 	USAGE_TAR_GZIP("\tz\t\tFilter the archive through gzip\n") \
 	USAGE_TAR_BZIP2("\tj\t\tFilter the archive through bzip2\n") \
 	USAGE_TAR_COMPRESS("\tZ\t\tFilter the archive through compress\n") \
 	"\nFile selection:\n" \
 	"\tf\t\tname of TARFILE or \"-\" for stdin\n" \
+	USAGE_TAR_FROM(\
+	 "\n\tT\t\tfile with names to include\n" \
+	 "\tX\t\tfile with names to exclude\n" ) \
+	"\nMiscellanous:\n" \
 	"\tO\t\textract to stdout\n" \
-	USAGE_TAR_EXCLUDE( \
-	"\texclude\t\tfile to exclude\n" \
-	 "\tX\t\tfile with names to exclude\n" \
-	) \
 	"\tC\t\tchange to directory DIR before operation\n" \
 	"\tv\t\tverbosely list files processed"
 #define tar_example_usage \


More information about the busybox mailing list