unzip: add -Z for "zipinfo mode".

But don't document it because it's a silly idea. Just call zipinfo
directly if you want zipinfo!

There are multiple uses of `unzip -Z` in the AOSP build, though, so we
may as well support it if people are already using it.

Test: manual
Change-Id: I04b05795badf63febe1210fbeaa96e3bd27237f1
This commit is contained in:
Elliott Hughes 2019-10-29 20:47:16 -07:00
parent 9786fbb9d3
commit d3aee6653f

View file

@ -435,6 +435,12 @@ int main(int argc, char* argv[]) {
};
if (role == kUnzip) {
// `unzip -Z` is "zipinfo mode", so in that case just restart...
if (argc > 1 && !strcmp(argv[1], "-Z")) {
argv[1] = const_cast<char*>("zipinfo");
return main(argc - 1, argv + 1);
}
int opt;
while ((opt = getopt_long(argc, argv, "-d:hlnopqvx", opts, nullptr)) != -1) {
switch (opt) {