//config: gunzip is used to decompress archives created by gzip.
//config: You can use the `-t' option to test the integrity of
//config: an archive, without decompressing it.
+//config:
+//config:config FEATURE_GUNZIP_LONG_OPTIONS
+//config: bool "Enable long options"
+//config: default y
+//config: depends on GUNZIP && LONG_OPTS
+//config: help
+//config: Enable use of long options.
//applet:IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP))
//applet:IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat))
}
return filename;
}
+
+#if ENABLE_FEATURE_GUNZIP_LONG_OPTIONS
+static const char gunzip_longopts[] ALIGN1 =
+ "stdout\0" No_argument "c"
+ "to-stdout\0" No_argument "c"
+ "force\0" No_argument "f"
+ "test\0" No_argument "t"
+ ;
+#endif
+
/*
* Linux kernel build uses gzip -d -n. We accept and ignore it.
* Man page says:
int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int gunzip_main(int argc UNUSED_PARAM, char **argv)
{
+#if ENABLE_FEATURE_GUNZIP_LONG_OPTIONS
+ applet_long_options = gunzip_longopts;
+#endif
getopt32(argv, "cfvqdtn");
argv += optind;